As we can declare
global v1, v2, v3 ...etc.
would be handy to be able to
delete global v1,v2, v3 ...etc
rather than
delete global v1
delete global v2
delete global v3 ....etc.
Deleting Globals
Moderator: Klaus
Deleting Globals
Life is just a bowl of cherries.
-
- Posts: 47
- Joined: Sat Nov 17, 2007 6:04 pm
If you've got a number of globals to delete, could you not just:
The code could be turbocharged with a 'repeat for each' method, but I thought I'd keep it simple!
Steve
Code: Select all
put "v1,v2,v3,v4,v5" into the lVariableList
repeat with i = 1 to number of items of lVariableList
delete global (item i of lVariableList)
end repeat
Steve
Deleting Globals
Could do that but would rather
be able to copy the
global declaration line(s) and put "delete"
in front.
be able to copy the
global declaration line(s) and put "delete"
in front.
Life is just a bowl of cherries.
Untested

Code: Select all
global a,b,c
on mouseUp
deleteGlobals
end mouseUp
on deleteGlobals
put line 1 of the script of me into theGlobals
delete word 1 of theGlobals
repeat for each item theItem in theGlobals
delete global theItem
end repeat
end deleteGlobals
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode