mIRC Home    About    Download    Register    News    Help

Print Thread
#268350 12/01/21 09:05 PM
Joined: May 2014
Posts: 4
V
Self-satisfied door
OP Offline
Self-satisfied door
V
Joined: May 2014
Posts: 4
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?


Awesome games and info in irc.abjects.net #420 (where stoners hang out)
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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!
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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)) )

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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!
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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.


Link Copied to Clipboard