mIRC Homepage
Posted By: tezaren Question using $'s - 18/07/06 09:55 PM
My queston is: how can I get the below code to work, displaying the actual tokens (say $1-20 in this example) instead of the actual text "$1", "$2", etc. For some reason it is not evaluating the way I am intending.

var %i = 1
tokenize 32 $1-

while (%i < 20) {
echo 3 -a $ $+ %i
inc %i ; next tok
}
Posted By: starbucks_mafia Re: Question using $'s - 18/07/06 10:08 PM
You need to evaluate the identifier an extra time using $eval().

Code:
var %i = 1
tokenize 32 $1-

while (%i &lt; 20) {
echo 3 -a $eval($ $+ %i, 2)
; next tok
inc %i
}


$eval($ $+ %i, 2) means it will evaluate $ $+ %i twice. Once to get $4 (for example), and then again to get the value of $4
Posted By: tezaren Re: Question using $'s - 18/07/06 10:23 PM
That is exactly what I was looking for. Cheers! smile
Posted By: PhantasyX Re: Question using $'s - 19/07/06 02:29 AM
Also, if you're interested you can use $<n>-<2> (eg. $1-20 or $4-6, etc.)
It will display <n> thru <n2>.
© mIRC Discussion Forums