local and do <commands> - what NOT to do

Peter TB Brett peter.brett at livecode.com
Thu Feb 18 06:01:38 EST 2016



On 18/02/2016 08:03, Kay C Lan wrote:
> The Dictionary entry for 'local' has this Example:
>
> -- To make a numbered list of variables:
> repeat with x=1 to 20
>    do "local tVar_" & x & "; put empty into tVar_" & x
> end repeat
>
> Which 'apparently' runs fine if you copy and paste it into the msg box. For
> the purposes of this discussion and so we can see what's going on I'm going
> to remix that to:

Are there any problems that can be solved by generating variable names, 
that couldn't be solved equally well (and without using "do") using an 
array?

                                   Peter

-- 
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Open Source Team

LiveCode on reddit: https://reddit.com/r/livecode




More information about the use-livecode mailing list