mIRC Home    About    Download    Register    News    Help

Print Thread
Mirc ignores $chr(9) #268350 12/01/21 09:05 PM
Joined: May 2014
Posts: 3
V
VectorOne Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
V
Joined: May 2014
Posts: 3
I am writing some reports that need to be columned. I have written code with calculates the $len(%name) and then prefixes/suffixes the data with $chr(32) enough to fill a column. This was unsuccessful as mirc seems to ignore spaces. It then dawned on me to use tab characters to get to a desired column start. Having figured that short names require an extra tab, I used $iif($len( $gettok($1,1,59)) > 5, $+ $chr(9), $+ $chr(9) $+ $chr(9) ) . This, and other attempts, to use tabs was unsuccessful as it appears that mirc also ignores tab characters on output to a #channel window. Is there a workaround for this?

Re: Mirc ignores $chr(9) [Re: VectorOne] #268351 12/01/21 09:33 PM
Joined: Feb 2003
Posts: 2,751
Raccoon Online
Hoopy frood
Online
Hoopy frood
Joined: Feb 2003
Posts: 2,751
Tab characters work in Custom @Windows for columnization. You can even define Tab Stops to dictate each column's edge. Up until the latest version (or 2) of mIRC, tabs were not respected in channel / query windows, an very few IRC clients actually do tab character expansion. Not sure why Khaled decided this is something mIRC needs now, but you shouldn't use it because you can't guarantee everyone will see what you see, the way you see it.

If you must use fixed column spacing in something you print to a channel / query window, then send sequences of $chr(160) non-breaking [hard] spaces.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Mirc ignores $chr(9) [Re: VectorOne] #268352 12/01/21 09:35 PM
Joined: Jan 2004
Posts: 1,562
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,562
you can use the $chr(160) hard space instead of the space.
or, since the extra spaces in a string of consecutive spaces are suppressed, you can insert a control code between consecutive spaces to allow them to be displayed, since they're technically not consecutive spaces anymore.

//var -s %string abc $chr(32) def | msg $chan $replace(%string, $+($chr(32),$chr(32)) , $+($chr(32),$chr(2),$chr(32),$chr(2)) )

Re: Mirc ignores $chr(9) [Re: maroon] #268354 13/01/21 06:34 AM
Joined: Feb 2003
Posts: 2,751
Raccoon Online
Hoopy frood
Online
Hoopy frood
Joined: Feb 2003
Posts: 2,751
The Control Code method doesn't really work anymore, since 99% of channels institute a setting to block messages that contain them (ie, MODE +c) which is typically a hard blocking of the message rather than just stripping out the control codes.

Unless you're on EFnet. Then this method works fine.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Mirc ignores $chr(9) [Re: Raccoon] #268392 20/01/21 04:50 AM
Joined: Jan 2004
Posts: 1,562
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,562
Another example is interleaving the tab with a visible character. In 7.64, the tabs are expanded in channels and status window same as happens in the @custom windows. Unlike 7.63 and earlier where the "!" appear to touch each other in #channel and "Status Window". Both using /say and /echo

//echo -ag $str($chr(9) $+ $chr(33),234)

Unfortunately, giving the appearance of consecutive spaces inserting tabs between them causes long messages to more easily run afoul of the 510 server line length limit

Re: Mirc ignores $chr(9) [Re: Raccoon] #268396 20/01/21 07:42 PM
Joined: Jan 2004
Posts: 1,562
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,562
Your example depends on people knowing how long something like that used to be, compared to its current length. My example in versions prior to 764 shows like "!!!", while the current version has the appearance of multiple spaces between each "!". It appears this has been an intentional departure from backwards compatibility, and is caused by this item in change log:

34.Extended tab character support to all windows.