Hi Cole,

'version' does not get zapped when all other globals are cleared.
You could
save all your globals (including version itself) in a property list,
set 'version' to the property list, call clearGlobals, then restore
everything
from your property list.

That's really a brilliant idea! I had to try if it works, and yes, it does! Here the code I used:

-- save all globals inside version
on saveGlobals
 global version
 g = the globals
 v = version -- orig. value
 version = [:]
 repeat with i=1 to g.count
   if g.getPropAt(i)<>#version then version[g.getPropAt(i)] = g[i]
 end repeat
 version[#_version] = v
end

-- restore all globals from version
on restoreGlobals
 global version
 g = the globals
 repeat with i=1 to version.count
if version.getPropAt(i)<>#_version then g[version.getPropAt(i)] = version[i]
 end repeat
 version = version[#_version] -- restore version
end


In DMX2004 you could even overwrite any "simple" calls to clearGlobals() by adding the following handler in some movie script, but this of course would mean touching the existing movie:

on clearGlobals
 saveGlobals()
 _gobal.clearGlobals()
end

Valentin
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to