Why?

Klaus Major k_major at os.surf2000.de
Thu Mar 6 17:41:01 EST 2003


Hi Tariel,

> ...
> Thanks for reply Klaus, but I guess it's more complicated than "repeat 
> for each xxx" is a READ-only thing". Well, at least it's inconsistent. 
> Sometimes it behaves as read only thing and sometimes allows you to 
> change it.
>  You can actually change LL inside the "repeat for each" loop but if 
> you are using "put AFTER" it fails.
> ...
>   repeat for each line LL in TestLog
>
>     -- put comma after LL -- Would NOT work
>     -- put 5 after LL -- Would NOT work
>
>     -- delete last char of LL -- works
>     -- add 10 to item 2 of LL -- works
>     -- delete last item of LL -- works
>     -- replace "No Answer" with "NO Answer yet" in LL -- works
>     -- put "OneMoreItem" into item 5 of LL -- works
>
>     put LL & cr after tTest1
>     add item 2 of LL to tTest
>   end repeat
> ...
> best regards
> Tariel

this is indeed very strange...

But this from the MC reference:
###
...
Note that when using the "for each" form, the variable gets set to each 
chunk in turn:
no need to precede it with the chunk type as is done in the first 
example.

You cannot change the variable being looped over without causing the 
loop
to lose track of which chunk to process next...!!!
...
###

Until i read this in the dox i also used to try to manipulate "each 
xxx" and never succeeded...

I think that this is really meant to be read-only but is a little 
tolerant from time to time ;-)


Anyway, have a nice weekend :-)


Regards

Klaus Major
k_major at os.surf2000.de




More information about the metacard mailing list