Lua 関数の UserVars は、ユーザ変数セットへのハンドルを返します。詳しくは 「マクロ」セクションの 変数 を参照してください。
この関数は、引数を受け取りません。
この例では、ユーザ変数の設定、取得、および削除を行っています。
local function main()
-- 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
return main