Initializing variables

David Vaughan drvaughan55 at mac.com
Sat Mar 9 20:33:01 EST 2002


On Sunday, March 10, 2002, at 02:11 , Jan Schenkel wrote:

> Hi Jim,
>
>> I have a list of variables, say "x,y,z"
>> I would like to set each of these equal to zero.
>
> You might want to replace the script with the
> following:
>
>  put "x,y,z" into tList
>  repeat with i = 1 to 3
>   do "put 0 into" && item i of tList
>  end repeat

Jim & Jan
A faster approach along the same lines (faster because there is less 
coding to put variables into a list) might be to get the list via the 
localNames() function. and remove the ones you do _not_ want to 
initialise...
cheers
David

>
> Best regards,
>
> Jan Schenkel
>
> "As we grow older, we grow both wiser and more foolish
> at the same time."  (De Rochefoucald)
>
<snip>




More information about the use-livecode mailing list