UserVars()

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » UserVars() Version 2.2

説明

The UserVars function returns a handle to the set of user variables. Read more about these in the Variables topic in the Macro section.

引数

この関数は、引数を受け取りません。

戻り値

  • handle:
    The function returns a handle of the set of user variables.

This example sets, gets, and deletes a user variable:

Lua
return function()
-- Stores a local Lua variable with the handle for the user variables.
local variableSection = UserVars()

-- Sets a user variable with an integer value using the SetVar function.
SetVar(variableSection, "myUserVar", 42)

-- Prints the user variable using the GetVar function.
Printf("The value of myUserVar is: " .. GetVar(variableSection, "myUserVar"))

-- Deletes the user variable using the DelVar function.
DelVar(variableSection, "myUserVar")
end