Thanks to j...@souslelogo.com for the suggestion that hasMemory(bytes) might be useful. I haven't tried this yet.

Thanks to <ad...@flexiblelearning.com> for replies to my other questions.

On the memory cost of writing fld "data" to tVar

Q2. Of course it does, but the same condition is in place in all three
tests. And the data has to come from somewhere.

My question was whether we could save memory (and if there is some other downside) if we write

repeat for each line L in fld "data"

rather than

put fld "data" into tVar
repeat for each line L in tVar

On the rules about "repeat for":

Q2. This 'repeat for each' rule refers to not modifying whatever 'each'
refers to. In this case, 'each' is a line and the number of lines in
unchanged so I am not changing the internal line pointers set up by the
engine at the start.

If your approach works consistently, it implies that LiveCode's dictionary is too restrictive when it says (regarding "repeat for each labelVariable in container"):

"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."

David Epstein

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to