mIRC Home    About    Download    Register    News    Help

Print Thread
#976 10/12/02 09:30 PM
M
madcow
madcow
M
ho come do i get a variable name like this:

%name%n

where n is being incremented

#977 10/12/02 09:49 PM
D
DarkStarX
DarkStarX
D
[ %<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,

#978 10/12/02 09:49 PM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
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
  }

#979 11/12/02 08:16 PM
S
SyN
SyN
S
I usually do somethin like

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

the periods make the variables a bit prettier


Link Copied to Clipboard