mIRC Home    About    Download    Register    News    Help

Print Thread
#227154 27/10/10 05:50 PM
Joined: Nov 2009
Posts: 81
V
Voglea Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
I received $rawmsg from server with spaces ($chr 32), how to save it to binary variable for future parsing?

Only $alias($rawmsg) saves spaces, but command /bset -t &bvar 1 $rawmsg loses their frown


Update: echo -a $len($rawmsg) = $len($replace($rawmsg,$chr(32),$chr(160))) works great, but may be there are other solutions smile

Last edited by Voglea; 27/10/10 05:59 PM.
Voglea #227158 27/10/10 06:29 PM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
you have the right idea with $replace(). however, since $chr(160) may appear in $rawmsg, it's inadvisable to use it in this case; you would be obliged to substitute any pre-existing $chr(160) characters back using a technique similar to the one i provided in this post:

http://forums.mirc.com/ubbthreads.php?ubb=showflat&Board=8&Number=226545&

it's safe to use $lf for the replacements, since you can be absolutely sure that $rawmsg won't contain it:

Code:
bset -t &var 1 $replace($rawmsg, $chr(32), $lf)
breplace &var 10 32




"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Voglea #227160 27/10/10 06:33 PM
Joined: Nov 2009
Posts: 81
V
Voglea Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
aw-w-wesome about $chr 10
many thanks!

Voglea #227213 01/11/10 11:34 AM
Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Originally Posted By: Voglea
aw-w-wesome about $chr 10
many thanks!


Character 10 is the character for LINEFEED (same as $lf). You are best using something like %2A instead of a single character.

Last edited by MeStinkBAD; 01/11/10 11:41 AM.

Beware of MeStinkBAD! He knows more than he actually does!

Link Copied to Clipboard