mIRC Homepage

Mirc ignores $chr(9)

Posted By: VectorOne

Mirc ignores $chr(9) - 12/01/21 09:05 PM

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?
Posted By: Raccoon

Re: Mirc ignores $chr(9) - 12/01/21 09:33 PM

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.
Posted By: maroon

Re: Mirc ignores $chr(9) - 12/01/21 09:35 PM

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)) )
Posted By: Raccoon

Re: Mirc ignores $chr(9) - 13/01/21 06:34 AM

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.
Posted By: maroon

Re: Mirc ignores $chr(9) - 20/01/21 04:50 AM

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
Posted By: maroon

Re: Mirc ignores $chr(9) - 20/01/21 07:42 PM

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.
© 2021 mIRC Discussion Forums