Q: variable name of variable
Hello all (especially @Niel & @Stivejobstan123 & @Camelot)
next question by beginner:
can I ask (and, actually, create) a variable by name in this way:
repeat 3 times
set i to 1
set a( i )to i*6
set i to i+1
end repeat
return a(2)
return a(x) etc.
PS I know about "on something () - end something"
but question about variable
MacBook Pro, OS X El Capitan (10.11.2), null
Posted on Jul 5, 2016 7:28 PM
Hello
Perhaps what you want is list which is an ordered collection of items.
set a to {}
repeat with i from 1 to 3
set a's end to i * 6
end repeat
return a
--return a's item 2
If you're indeed looking for something like hash table (associative array), you might try the code listed in the following thread.
Set an indeterminate number of variables
https://discussions.apple.com/thread/7000650
Good luck,
H
Posted on Jul 7, 2016 9:35 AM