Bob Sneidar wrote :
> T he reason for all this is that to optimize the repeat loop, the engine
> makes one pass through the data, and creates an index of pointers to the
> delimiters. If you modify the data, the OS may (and probably will) do some
> memory shuffling > and the pointers will no longer be valid. What you return
> can be bits and pieces of the original data scrambled like eggs, or random
> bits of what is now in that memory space. Ick!
>
> ex. repeat for each line pLine in pData. Don?t alter pLine or pData inside
> the repeat control structure.
I am on digest list form, so there probably have been people before me to
address this. To be sure, here goes :
I think the first part of what Bob says is true, you cannot alter the original
data. But as you go into each turn of the loop and take rLine (see) below as a
chunck, you can do with rLine whatever you like. I do that all the time. Only
if you change the original data ( e.g. tPermutations) then the thing fouls.
As an example :
on mouseUp
put empty into Changed
repeat for each line rLine in tPermutations
put 6 into item 3 of rLine -- ** here I change rLine, which does not
affect tPermutations
put rLine & cr after Changed
end repeat
end mouseUp
Beat Cornaz
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode