If you have a really large number of globals, sometimes it can be helpful to consider using an array for those, e.g.:
Code: Select all
global gMyGlobalsA
on mouseUp
put "Something" into gMyGlobalsA[1]
put "SomethingElse" into gMyGoobalsA[2]
end mouseUp
on ClearGlobals
put empty into gMyGlobalsA
end ClearGlobals
In that example they keys are numeric only because that seems to reflect the naming style in your code. You can also use strings for array element keys:
Code: Select all
put "Something" into gMyGlobalsA["SomeKey"]
And you can also use variables as key names:
Code: Select all
put "SomeKey" into tKeyName
put "Something" into gMyGlobalsA[tKeyName]