• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dynamic variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamic variables


  • Subject: Re: dynamic variables
  • From: julifos <email@hidden>
  • Date: Thu, 24 Jul 2003 18:36:22 +0200

> 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

Hmmm... I don't understand very well... I guess you will do anything with
such variables?

If you have 100 numbers, you can assign a temporary variable name to each
one if you use a repeat loop. Eg:

x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x
set my100Numbers to {2,7,72} --> which are only three ;-)

repeat with x in my100Numbers
--> every loop (will be 3 loops), "x" will take a different value
display dialog (x as text) --> first loop: 2, second one: 7 & third: 72.
end repeat
x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

Perhaps if you describe your wishes more exhaustivelly...

Cheers!

jj
_______________________________________________
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.

  • Prev by Date: Scripting addition for MacOS X.
  • Next by Date: Re: Scripting addition for MacOS X
  • Previous by thread: Re: dynamic variables
  • Next by thread: Re: dynamic variables
  • Index(es):
    • Date
    • Thread