Re: dynamic variables
Re: dynamic variables
- Subject: Re: dynamic variables
- From: "Steven D. Majewski" <email@hidden>
- Date: Thu, 24 Jul 2003 13:07:54 -0400
On Thursday, July 24, 2003, at 10:55 AM, jay wrote:
>
Thanks for your reply jj.
>
>
I'm not sure if that is what I am looking for. It could be better
>
described with an example: My program is going to get 100 numbers
>
while it is running (say from the user). I need to save all 100
>
numbers. Instead of defining 100 variables outright I want my script
>
to create a new variable every time it receives a new number. Thus my
>
program would start with 0 number variables and end with 100 variable
>
numbers.
>
>
Any insight is appreciated,
>
-j
>
Start with an empty list, and append numbers to it as needed.
set a to {}
repeat with i from 1 to 20
set a to a & i
end repeat
a
--> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20}
first item of a
--> 1
last item of a
--> 20
item 4 of a
--> 4
choose from list a with prompt "Pick a number"
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.