mIRC Homepage
Posted By: Voglea $rawmsg to &bvar - 27/10/10 05:50 PM
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
Posted By: jaytea Re: $rawmsg to &bvar - 27/10/10 06:29 PM
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


Posted By: Voglea Re: $rawmsg to &bvar - 27/10/10 06:33 PM
aw-w-wesome about $chr 10
many thanks!
Posted By: MeStinkBAD Re: $rawmsg to &bvar - 01/11/10 11:34 AM
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.
© mIRC Discussion Forums