49
edits
(getglobal deprecated, replace with _G) |
No edit summary |
||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
getglobal and [[API_setglobal|setglobal]] are deprecated and replaced with _G[]<ref>http://forums.worldofwarcraft.com/thread.html?topicId=25626580975&sid=1</ref> | ''Note: getglobal and [[API_setglobal|setglobal]] are deprecated and replaced with _G[]<ref>http://forums.worldofwarcraft.com/thread.html?topicId=25626580975&sid=1</ref>. Change all references of getglobal and setglobal:'' | ||
var = getglobal(varName) --getglobal deprecated | var = getglobal(varName) --getglobal deprecated | ||
| Line 9: | Line 8: | ||
setglobal(otherName, otherVar) --setglobal deprecated | setglobal(otherName, otherVar) --setglobal deprecated | ||
_G[otherName] = otherVar --new syntax to set a global | _G[otherName] = otherVar --new syntax to set a global | ||
== Description == | == Description == | ||
Get a global variable, from a string. | Get a global variable, from a string. | ||
local targetGlobal = getglobal("globalName") | local targetGlobal = getglobal("globalName") | ||
== Arguments == | |||
:("globalName") | :("globalName") | ||
:;globalName : String - Name of the global you want to get. | :;globalName : String - Name of the global you want to get. | ||
== Returns == | |||
:;The value from the given string, or nil if not found | :;The value from the given string, or nil if not found | ||