setglobal is deprecated and replaced with _G[]
No edit summary |
(setglobal is deprecated and replaced with _G[]) |
||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
[[API_getglobal|getglobal]] and setglobal are deprecated and replaced with _G[]<ref>http://forums.worldofwarcraft.com/thread.html?topicId=25626580975&sid=1</ref>. Their functionality will be removed from the game at a future date. Change all references of getglobal and setglobal: | |||
var = getglobal(varName) --getglobal deprecated | |||
var = _G[varName] --new syntax to get a global | |||
setglobal(otherName, otherVar) --setglobal deprecated | |||
_G[otherName] = otherVar --new syntax to set a global | |||
Set a global variable, from a string. | Set a global variable, from a string. | ||
setglobal( "globalName", value ) | setglobal( "globalName", value ) | ||