Sets a global variable to a specified value. Allows setting the value of a global variable in contexts where its name might be overridden by that of a local variable; i.e. setglobal(name, value) is equivalent to _G.name = value or _G["name"] = value.


See also Utility functions.

Signature:

setglobal("name", value)

Arguments:

  • name - Name of a global variable (string)
  • value - New value for the variable (value)
This function is defined by the default user interface in Lua. You can find the definition by examining the FrameXML code for the default UI,