— VERSION: 2.0 ⇢ 2016-05-28 —
Updated: 2017-05-04 5:09 PM CT
UPDATE: 2017-05-04 5:09 PM CT
- I now have better methods for deleting KM Variables.
- I will be posting new macro(s) soon.
- For now, see the macro/script at the bottom of this topic.
The primary use case for this macro is to "clean-up", aka "delete" the variables used in another macro. So you would typically call ("Execute Macro") this sub-macro as the LAST Action in your calling macro.
An example, test, macro that demonstrates use of this sub-macro is provided at the bottom of this post.
Thanks to @DanThomas for suggesting use of the Execute Macro Parameter. This new version (2.0) now provides 3 ways of transmitting the variable list, including via the Parameter:
• Delete All KM Variables in a list of KM Variables
• The main use for this is at the END of the calling Macro to "clean" (delete) the Variables used in that Macro
• To be used ONLY if you have two or more variables to delete.
HOW TO USE:
FROM THE CALLING MACRO:
• Add a "Execute Macro" Action, calling this sub-macro
• Choose the method of transmitting the variables to be deleted.
THREE WAYS TO TRANSMIT THE VARIABLES TO BE DELETED
 Set the Variable "KMVars_To_Delete" to list of variables
(Do NOT use the Execute Macro Parameter)
This assumes the Calling Macro has set the Variable "KMVars_To_Delete" to a list of variables, one per line, that are to be deleted.
 Set the Execute Macro Parameter to a CSV list
IF there is a COMMA in the Parameter of the Execute Macro action, it is assumed that the Parameter contains a list of comma separated values (CSV) that is a list of Variables to be deleted.
 Set the Execute Macro Parameter to the Name of a Variable Name that contains list to delete
and create the Variable with the list of variable names.
It is assumed that IF the Parameter contains just ONE Variable Name that this Variable contains the list (one per line) of Variables to be deleted.
You might also be interested in this macro:
MACRO: [KM] DELETE All Variables Except Those on Keep List
DELETE KM Vars TEST.kmmacros (4.5 KB)
If for some reason you want to use this macro to delete ONLY one variable, just put a comma after the variable name in the Parameter field: