Delete variable action

Jacob L

Moderator (Lawsonator)
We have an action to create variables at run time but we don't have to delete variable action. This could lead to multiple variables being created but not deleted
 

Endercraft

Moderator (& bug finder :D)
There's no create variable action... There is the option in the set variable option,is that what you mean?
 

Dm114

Well-known member
We have an action to create variables at run time but we don't have to delete variable action. This could lead to multiple variables being created but not deleted
Hi @Jacob L

As @Endercraft I think you are wrong as I didn't find a way to create a variable at run time, neither.

It's only possible when coding. But you're right: it could be an interesting feature (creating and deleting) to spare some MD space.

To spare as much space as possible I actually erase all non necessary string/array/dictionary variables before closing a macro (so I generally can't use the Back button=Cancel option to run the macro till its last Erase statement).

It's unnecessary to erase other variable types as the allocated space is the same whatever the value stored.
 

Jacob L

Moderator (Lawsonator)
There's no create variable action... There is the option in the set variable option,is that what you mean?
Yes. Untick create variable now. Then when the action runs, it creates the variable. If you do this with a variable as the variable name it will create lots and lots of variables
 

Endercraft

Moderator (& bug finder :D)
I know by looking in the JSON the variable is saved and recreated in case it doesn't exist. That's probably what's going on here.
 

Dm114

Well-known member
It only empties them, that still leaves loads of variable placeholders
Yes, it's exactly what I said. But it's the only thing we can do now to free some space, mainly when these string/array/dictionary variables contain a big amount of data.

It also was the reason why, at the beginning, I used to use global variables rather than local ones. But local ones are sometimes somehow more "comfortable", more convenient. 😉

Sometimes I also use files to store big enough amounts of data outside MD (without forgetting to free space/clear action before closing macros).
 
Top