mIRC Home    About    Download    Register    News    Help

Topic Options
#976 - 10/12/02 09:30 PM varaibles name
madcow Offline
Mostly harmless

Registered: 10/12/02
Posts: 1
ho come do i get a variable name like this:

%name%n

where n is being incremented

Top
#977 - 10/12/02 09:49 PM Re: varaibles name
DarkStarX Offline
Ameglian cow

Registered: 09/12/02
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."

Top
#978 - 10/12/02 09:49 PM Re: varaibles name
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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

Top
#979 - 11/12/02 08:16 PM Re: varaibles name
SyN Offline
Ameglian cow

Registered: 11/12/02
Posts: 32
Loc: NY USA
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.

Top