Clearing local variables

Kay C Lan lan.kc.macmail at gmail.com
Thu Apr 28 22:30:16 EDT 2016


On Thu, Apr 28, 2016 at 11:47 PM, Mark Waddingham <mark at livecode.com> wrote:

>
> From 7.0 onwards, this causes no problem as the engine takes a 'copy' of
> the target variable at the start of the loop. (Note you only pay for that
> copy when you mutate tList subsequently, and that mutation has no effect on
> the repeat for each loop being performed).
>
> Oh, so if your repeat script works now in LC 7/8 it comes with a Mark W
guarantee that it'll work in the future. ;-) Cool!

Does that mean the 'Important' note in the LC 8 Dictionary entry for
'repeat' isn't so Important any more?

Important: In any of the for each loops, you should not change the
> labelVariable or container in a statement inside the loop. Doing so will
> not cause a script error, but will almost certainly produce unexpected
> results.



More information about the use-livecode mailing list