Using 'for each' to modify a container

J. Landman Gay jacque at hyperactivesw.com
Wed Oct 11 23:14:38 EDT 2006


Bill Marriott wrote:

> And I'm *really* concerned about the second part of your report
> 
>> Further, I don't reuse the name 'thisLine' in the next instance of a 
>> repeat
>> for each loop in the *same handler*, but change the name to avoid 
>> conflict,
>> such as 'thisline', 'thisline1', 'thisLine2'.  Again, unpredictable 
>> results
>> occasionally.
> 
> Surely THAT is a definite bug?! Have other people experienced this? Are you 
> able to reproduce it? Is there a bug on it already filed? I do this all the 
> time and I'd have to update a lot of code to fix it.

For what it's worth, I do it all the time too and have never had a 
problem. I think maybe the original poster was just being cautious.

The first part though, about not changing the contents of a loop 
variable, does give unexpected results though I hardly ever get an 
actual script error. Usually I just get scrambled variables.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list