grandMA3 User Manual Publication

DelVar(handle, string)

grandMA3 User Manual » Plugins » Lua Functions - Object-Free API » DelVar(handle, string)
Version 2.1

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

  • Handle:
    The handle of variable set.
  • String:
    The name of the variable. It needs to be in quotation marks.

Return

  • 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

This example deletes a variable called "myUserVar" in the set of user variables.

Lua
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!")
end
end