# Multiple variable nesting

## Recommended Posts

i have many variable doing different task , hope someone can fix this dead knot

this variable is declared and use \$1num1 ..... until \$10num10

is there any way to call the above variable using a loop

eg: \$x =1 and loop to \$x=10 , \$y=1 and loop to \$y=10

to fulfill this condition :

if \$(\$x)num(\$y) then ;{do something}

thank you

##### Share on other sites

For \$X = 1 to 10

ConsoleWrite(Eval(\$X & "num" & \$X))

Next

Edited by weaponx

##### Share on other sites

i have many variable doing different task , hope someone can fix this dead knot

this variable is declared and use \$1num1 ..... until \$10num10

is there any way to call the above variable using a loop

eg: \$x =1 and loop to \$x=10 , \$y=1 and loop to \$y=10

to fulfill this condition :

if \$(\$x)num(\$y) then ;{do something}

thank you

You should just work with an array:

```Global \$avNum[10] = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] ; indexes are 0 thru 9

\$x = 1
\$y = 2

\$avNum[\$x] = "This is my variable."
\$avNum[\$y] = "There are many like it, but this one is mine."
\$avNum[\$x + \$y] = \$avNum[\$x] & "  " & \$avNum[\$y]

For \$n = 0 To 9
ConsoleWrite("Debug: \$avNum[" & \$n & "] = " & \$avNum[\$n] & @LF)
Next```

And weaponx knows better: "Assign/Eval are evil!" "Bad mutant!"

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

##### Share on other sites

I don't use either in my scripts. Much like the movie Hellraiser, I have been to the 4th dimension and I am the array master.

##### Share on other sites

I don't use either in my scripts. Much like the movie Hellraiser, I have been to the 4th dimension and I am the array master.

4-dimensional arrays *shudder*

Took me long enough to juggle some of my 2-dim issues effectively

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...