Deleting Global Variables

Post your questions and help other users.

Moderator: Martin

Post Reply
98b427af

Deleting Global Variables

Post by 98b427af » 26 Nov 2013 00:28

How do I delete a global variable from within a flow or script? Assigning 'null' like this doesn't do it:

Code: Select all

global_aVar = null;
The variable still appears in the list of global variables, with a value of 'null'.

Thanks.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Deleting Global Variables

Post by Martin » 02 Dec 2013 17:33

Hi,

There is currently no way to delete a variable in script. You have to use menu->Manage->Global Variables to completely delete a global variable.
I have added it to my todo-list to add a way to do this from a script.

Regards,
Martin

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Deleting Global Variables

Post by kintrupf » 09 Jan 2014 14:14

Please bump up the priority of this a bit.
Having a "removeVariable" function which is not able to remove global variables is a bit pointless, since local variables are automatically deleted when a flow ends... ;)

98b427af

Re: Deleting Global Variables

Post by 98b427af » 09 Jan 2014 19:54

It does remove globals, at least as of v1.20.0. Remember to pass the variable name as a string:

removeVariable("global_x")

User avatar
kintrupf
Posts: 257
Joined: 10 Sep 2013 08:59

Re: Deleting Global Variables

Post by kintrupf » 09 Jan 2014 20:08

98b427af wrote:It does remove globals, at least as of v1.20.0. Remember to pass the variable name as a string:

removeVariable("global_x")
Ups, that I didn't try :roll:
Works, thank you!

Post Reply