DelVar(handle, string)
Description
Section titled âDescriptionâThe DelVar Lua function deletes a specific variable in a set of variables. To learn more about the variables in plugins, have a look at the Variable Functions topic.
Arguments
Section titled âArgumentsâ- Handle:
The handle of variable set. - String:
The name of the variable. It needs to be in quotation marks.
-
Boolean:
- True / 1: The variable was deleted.
- False / 0: The variable was not deleted.
If the variable does not exist, then false is also returned.
Example
Section titled âExampleâThis example deletes a variable called âmyUserVarâ in the set of user variables.
| Copy CodeLua |
| ``` |
| return function() |
-- Deletes the variable called 'myUserVar' in the 'UserVars' variable set.local success = DelVar(UserVars(), "myUserVar")-- Prints the outcome of the deletion outcome.if success then Printf("Variable is deleted.")else Printf("Variable is NOT deleted!")endend