And "top level" variables count as globals in this respect. If the
'global' declaration above is omitted, runNr still increments over
runs.
I think there was a bug in the earlier versions of Tiger, whereby
globals
and properties _didn't_ persist. But that's been fixed for a while
now.
To "remove garbage from a script between runs", you can set its
globals
to less bulky values (eg. "") before it finishes, or, preferably, use
locals instead.
I solve this problem by simply avoiding the use of globals. Always.
My run handlers always start with ...
on run
local ...
followed by a list of all "top-level" variables. I pass variables to
handlers, instead, which can sometimes be a pain. I'm convinced that
globals were never intended to be persistent, but someone made a
mistake and we are stuck with it.