Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

butteryak

macrumors newbie
Original poster
May 12, 2011
4
0
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....
 
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.
 
I'm using applescript, yes the above "code" wasn't code per-say, just an outline of what I was looking to do......:)
 
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.
 
thanks!

sounds good....I'll take a look....looks like the direction I needed...
thanks again!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.