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,721
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,721
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,465
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,465
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,721
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,721
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!