PDA

View Full Version : numbered variable?




butteryak
May 12, 2011, 01:20 PM
Hey I'm looking to create a numbered incremental variable,

and be able to use those variables depending on what number is being created in a loop. kinda hard to explain.....but....

var1 = 123
var2 = 456
var3 = 789
var4 = 012

x = 1
repeat
display var(x) (so that depending on what x is I'd display var1 or var2 or...)
x=x+1
end repeat

is the jist of it does that make sense to anyone? I can't seem to find the answer after a fair amount of digging around.... thanks for your guidance!! for an applescript noob....



chown33
May 12, 2011, 01:28 PM
Use an array.

If you don't know what an array is, then identify which programming language you're using, and we can give more specific information. I can't tell what the programming language is from what you posted. It might be AppleScript, but I'm just guessing.

butteryak
May 12, 2011, 01:32 PM
I'm using applescript, yes the above "code" wasn't code per-say, just an outline of what I was looking to do......:)

chown33
May 12, 2011, 01:56 PM
In AppleScript, an array is called a list.

Google search terms like these:
applescript array tutorial
applescript list tutorial
applescript list examples
applescript arrays
applescript lists

Or look up the word "list" in an AppleScript reference book.

butteryak
May 12, 2011, 06:36 PM
sounds good....I'll take a look....looks like the direction I needed...
thanks again!