mIRC Homepage
Posted By: Div reading a variable from a variable? - 15/11/07 01:01 PM
Code:
alias ttt {
  var %a = oioi
  var %b = welcome
  var %c = hello
  var %order = a b c
  echo -a check: [ % $+ $gettok(%order,1,32) ]
}


Can someone get this to work pls?
I want something like this cause for me it matters in what order %order is set to.

Thanks alot in advance!
Posted By: qwerty Re: reading a variable from a variable? - 15/11/07 01:09 PM
echo -a check: % [ $+ [ $gettok(%order,1,32) ] ]
or
echo -a check: $eval(% $+ $gettok(%order,1,32),2)
Posted By: RoCk Re: reading a variable from a variable? - 15/11/07 01:18 PM

What about b and c ?

echo -a check: $eval($+(%,$replace(%order,$chr(32),$+($chr(32),%))),2)

~ Edit ~

Removed $gettok()

Posted By: qwerty Re: reading a variable from a variable? - 15/11/07 01:26 PM
Div's code looks like a test case, where 1 was used instead of a counter in $gettok() (ie it looks like he just wants to know how to evaluate dynamic variables). He'll have to be more specific if he wants something else in addition.

Edit: like what you posted smile
© mIRC Discussion Forums