mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 252
T
Talon Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 252
User requested help with a script that set a variable to $1-, did a number of operations on a variable with multiple ifs and replaces, etc.. and returned the final output of the variable. Came across a situation where if $1- was literally a simple mathematical equation it in turn was evaluated instead of just returning. To save time, here's how to reproduce what's happening.

Code demonstrating the effect:

//tokenize 32 3 + 3 | var %b = $1- | echo -a %b
or
//tokenize 32 3 + 3 | set -l %b $1- | echo -a %b

Result: 6


Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Yes, that's why there's the -n switch for /var and /set.


Saturn, QuakeNet staff
Joined: Dec 2002
Posts: 252
T
Talon Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 252
hmm, didn't try that, apparently it works, I figured by definition anything passed would be treated as plaintext and %b would literally be $1-


Link Copied to Clipboard