mIRC Home    About    Download    Register    News    Help

Print Thread
#227154 27/10/10 05:50 PM
V
Voglea
Voglea
V
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.
#227158 27/10/10 06:29 PM
Joined: Feb 2006
Posts: 523
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 523
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:

https://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
#227160 27/10/10 06:33 PM
V
Voglea
Voglea
V
aw-w-wesome about $chr 10
many thanks!

#227213 01/11/10 11:34 AM
M
MeStinkBAD
MeStinkBAD
M
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.

Link Copied to Clipboard