mIRC Homepage

varaibles name

Posted By: madcow

varaibles name - 10/12/02 09:30 PM

ho come do i get a variable name like this:

%name%n

where n is being incremented
Posted By: DarkStarX

Re: varaibles name - 10/12/02 09:49 PM

[ %<name> [ $+ %n ] ]

example:
var %a1 3
var %a2 2
var %a3 1
var %i 1
while (%i <= 3) {
echo -a [ %a [ $+ %i ] ]
inc %i
}

Would output:

3
2
1

Regards,
Posted By: Hammer

Re: varaibles name - 10/12/02 09:49 PM

The following snippet shows you how to set and read variables you don't know the exact names of, but they're similarly named.
Code:
  var %n = 1
  while (%n &lt; 11) {
    set $+(%,name,%n) $ticks
    inc %n
  }
  var %n = 1
  while ($var(%name*,%n)) {
    echo -sti2 ** $ifmatch = $eval($ifmatch,2)
    inc %n
  }
Posted By: SyN

Re: varaibles name - 11/12/02 08:16 PM

I usually do somethin like

set %some.variable. $+ %i
then read it by
%some.variable. [ $+ [ %i ] ]

the periods make the variables a bit prettier
© 2019 mIRC Discussion Forums