Does exist a simple way to remove variables?

Maybe somebody know a simple way to remove variables what was created during the script testing for example if you create rollout

rollout rl_test "Some Rollout" width:100 height:100
(
  checkbutton myButton "My Button" width:80 height:24
)
createDialog rl_test

if I execute code bellow before rollout is created

rl_test.myButton.state

then I get
-- Unknown property: "myButton" in undefined
and this is fine because max doesn't know about such a rollout and button

but after rollout was created it always returns some value even if rollout was closed. Maybe are some smart way to clear this data from Max memory without restarting Max.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

var = undefined

the simplest way is just to set your variable to undefined --
rl_test = undefined
that not remove those variable from the global space memory, but its quite enough for testing, and to remove them completely you can use globalVars structore --
if globalVars.isglobal "rl_test" do globalVars.remove "rl_test"
But read the notes about globalVars in the help, Cheers!

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.