Actions Variables

This group of actions lets you directly set the values of any globally-defined variables in the Lua state. All variables are global unless they are prefixed with the "local" keyword, or if they are part of a module.

XLua supports the complete Lua syntax for variable names, including accessing tables and arrays. Some examples of valid names are:

Be aware of the difference between numeric and string indices. [1] and ['1'] are both valid, but different indices. A name such as mylist.1 is an invalid Lua name, but is valid in XLua and is the same as mylist['1'].

Currently there is the limitation that ., [], ', and " characters cannot be used in string indices.

Set Integer Variable

Sets a variable in lua's global namespace to the specified floating-point value.

Parameters

String Variable name
Value Integer value

Set Floating Variable

Sets a variable in lua's global namespace to the specified floating-point value.

Parameters

String Variable name
Value Floating-point value

Set String Variable

Sets a variable in lua's global namespace to the specified string value.

Parameters

String Variable name
String String value

Set Boolean Variable

Sets a variable in lua's global namespace to the specified boolean value.

Parameters

String Variable name
Value 1 = true, 0 = false

Delete Variable

Sets a variable in lua's global namespace to nil, effectively deleting it.

Parameters

String Variable name

Copyright 2010 Justin Aquadro