mIRC Home    About    Download    Register    News    Help

Print Thread
#976 10/12/02 09:30 PM
Joined: Dec 2002
Posts: 1
M
madcow Offline OP
Mostly harmless
OP Offline
Mostly harmless
M
Joined: Dec 2002
Posts: 1
ho come do i get a variable name like this:

%name%n

where n is being incremented

#977 10/12/02 09:49 PM
Joined: Dec 2002
Posts: 24
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
[ %<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,


-DarkStarX
"If at first you don't succeed, sky diving's not for you."
#978 10/12/02 09:49 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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
  }


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#979 11/12/02 08:16 PM
Joined: Dec 2002
Posts: 32
S
SyN Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 32
I usually do somethin like

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

the periods make the variables a bit prettier


It's only called insanity if you're poor.
I stay alive to spite those that wish me dead.

Link Copied to Clipboard