mIRC Home    About    Download    Register    News    Help

Print Thread
#233802 13/09/11 01:30 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
a user on IRC just reported an issue with $strip() when used with control code switches. apparently it is removing ctrl+o in all cases:

Code:
//echo -a $len($strip($chr(15), c)) - $len($strip($chr(15), b)) - etc.


gives '0 - 0 - etc.'.

this can be undesirable, and doesn't make sense given that the result of $strip( , x) would already be free of control codes 'x' without having to touch ^O. i would expect this to only occur when $strip() is used without any options, or when it's used with all of the 'burci' options.


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Sep 2011
Posts: 3
U
Self-satisified door
Offline
Self-satisified door
U
Joined: Sep 2011
Posts: 3
Yes, I can only use some temp fix:
Code:
var %text = $+(T,$chr(15),$chr(3),$chr(3),$chr(3),e,$chr(15),s,$chr(15),t)
echo -a $len($strip($replace(%text,$chr(15),.),burc))

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
This SHOULD correct strip's problem, and I added an "o" switch to remove ^O:
Code:
alias stripfix {
  if ($0 != 2) return $strip($1)
  return $replacex($strip($replacex($iif(o isincs $2,$remove($1,$chr(15)),$1),\,\x5C,$chr(15),\x0A),$2),\x0A,$chr(15),\x5C,\)
}


I am SReject
My Stuff
Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
'o' already exists as an option for $strip(). otherwise, nice :P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Dec 2002
Posts: 5,465
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,465
Thanks this has been fixed for the next version.


Link Copied to Clipboard