How to remove a boolean variable from the memory - Forum

Forum Navigation
You need to log in to create posts and topics.

How to remove a boolean variable from the memory

So when I use a boolean variable I can't delete it from the memory because it keeps giving the error that ("" is not a valid boolean value).

I tried ClearVariables and Setvar to [null] but none of them worked. Should I re-define it as a string or something and then try to clear it?

@smnmhmdy

From the Help file ...

In order to delete a variable created with DefineVar, you must first re-declare the variable as “Undefined”, then clear it with SetVar. For example:
DefineVar "[Birthdate]" "Undefined" "" "Global" ""
SetVar "[Birthdate]" ""

... so this works ...

DefineVar "[gkBool]" "Boolean" "" "Global" "True"
AlertBox "gkBool" "[gkBool]"
DefineVar "[gkBool]" "Undefined" "" "Global" ""
SetVar "[gkBool]" ""
AlertBox "gkBool After" "[gkBool]"

 

luishp, SmnMhmdy and 2 other users have reacted to this post.
luishpSmnMhmdyproforma.guyotmazzu001