Repeat for each line of a variable or field?
J. Landman Gay
jacque at hyperactivesw.com
Sat Jan 12 18:23:27 CET 2019
Variables are always faster, but how much faster depends on what you're
doing in the "etc" part. Just reading the lines will be quicker than
writing back to the field on each iteration.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On January 12, 2019 10:03:33 AM David Epstein via use-livecode
<use-livecode at lists.runrev.com> wrote:
> I've done a little bit of speed testing showing extremely slight
> differences, but wonder if anyone who understands the "engine" can advise
> on this:
> Is there a difference between these two approaches?
> (1) put fld 1 into txt; repeat for each line k in txt; etc.
> (2) repeat for each line k in fld 1; etc.
> For no very good reason, I tend to do (1), but have begun to wonder: for a
> very lengthy field 1, does my writing to a variable use up more RAM, and so
> perhaps injure performance? Or is the engine in effect writing to a
> variable either way? Is a variable read more quickly than a field?
> Many thanks.
> David Epstein
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode