Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API getglobal

Last wiki revision 2019-12-20

Returns the value of a global variable by name (or key). Deprecated, use the global table _G instead: value = getglobal(globalKey) --getglobal deprecated value = _G[globalKey] --new syntax to get a global

  • globalKey : Any - "Name" of the global you want to get.
  • value : Any - The value of the specified global variable.

Accesing globals by name may be useful when dealing with arrays of widgets: for i=1, 10 do local curFrame = _G["MyAwesomeFrame" .. i] -- do something with curFrame, like position it: curFrame:SetPoint("TOP", 0, -20*i) end

Source

https://warcraft.wiki.gg/wiki/API_getglobal · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.