Initializing variables
Jan Schenkel
janschenkel at yahoo.com
Sat Mar 9 10:14:01 EST 2002
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
Best regards,
Jan Schenkel
"As we grow older, we grow both wiser and more foolish
at the same time." (De Rochefoucald)
--- Jim Hurley <jphurley at jps.net> wrote:
> I have a list of variables, say "x,y,z"
> I would like to set each of these equal to zero. If
> I were to use the
> following:
>
> put "x,y,z" into tList
> repeat with i = 1 to 3
> put 0 into item i of tList
> end repeat
>
> This would of course replace the list x,y,z by 0,0,0
> and not achieve
> my objective.
>
> Instead I want x,y, and z to take on the values 0.
> I've tried quotes
> and value() without success. My actual list is very
> long and it would
> be awkward to
>
> put 0 into x
> put 0 into y
> put 0 into z
>
> Any thoughts on an efficient way of assigning values
> to variables
> within a list?
>
> Thanks,
>
> Jim Hurley
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
>
http://lists.runrev.com/mailman/listinfo/use-revolution
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
More information about the use-livecode
mailing list