For Each Anomaly

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Jun 19 10:23:32 EDT 2007


Hi Michael,

Using repeat for each *must not* modify the variable used:
Here tPerson is modified when running:

   repeat for each line tPerson in tpeople
     put "s" after tPerson
     put tPerson & return after holder
   end repeat

This leads to unexpected results.
Instead try:

   repeat for each line tPerson in tpeople
     put tPerson & "s" & cr after holder
   end repeat

And this will work as expected :-)

Le 19 juin 07 à 16:16, Michael Kann a écrit :

> This seems urgent enough to send out an alert. If you
> use the "for each" loop to manipulate text this bug
> will be of interest.

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list