Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(getglobal and setglobal deprecated, use _G[] instead)
 
m (→‎Patch changes: Patch template fix)
 
Line 1: Line 1:
{{wowapi}}
+
{{stub/Cataclysm}}
  +
<onlyinclude>{{{{{tpl|tooltip}}}
{{removedfromgame|patch=4.0.1}}
 
  +
|mode={{{mode|}}}
  +
|arg={{{arg|}}}
  +
|name=Dark Ranger's Crossbow
  +
|quality=Common
  +
|icon=inv weapon crossbow 02
  +
|itemid=54986
  +
|bind=BoP
  +
|slot=Ranged
  +
|type=Crossbow
  +
|dmg=11-22
  +
|speed=2.80
  +
|dps=6.1
  +
|ilvl=6
  +
|sell={{cost|||28}}
  +
}}</onlyinclude>
   
  +
'''Dark Ranger's Crossbow''' is a quest reward from {{quest|Leader of the Pack}}.
[[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:
 
   
  +
==Patch changes==
var = getglobal(varName) --getglobal deprecated
 
  +
{{Patch 4.0.3a|note=Added}}
var = _G[varName] --new syntax to get a global
 
   
  +
==External links==
setglobal(otherName, otherVar) --setglobal deprecated
 
  +
<!-- Read http://www.wowwiki.com/WoWWiki:External_links before posting your links here.
_G[otherName] = otherVar --new syntax to set a global
 
  +
Links that do not conform to the rules will be DELETED.
  +
Repeat violations may result in a BAN.
  +
Have a nice day. :) -->
  +
{{elinks-item|54986}}
   
  +
[[Category:World of Warcraft common quest rewards]]
 
  +
[[Category:World of Warcraft crossbows]]
Set a global variable, from a string.
 
setglobal( "globalName", value )
 
 
== Parameters ==
 
=== Arguments ===
 
:("globalName", value)
 
 
:;globalName : String - Name of the global you want to change.
 
:;value : Any - Value you want to set the global to.
 
 
=== Returns ===
 
:;Always returns nil.
 
 
== Example ==
 
/script setglobal( "MyVariable", 1234 )
 
 
=== Result ===
 
MyVariable = 1234
 
 
== Details ==
 
As of the introduction of [[API getfenv|getfenv]]() into the API, setglobal() and [[API getglobal|getglobal]]() are somewhat superfluous. You can always do something along the lines of:
 
local _G = getfenv()
 
local prevval = _G["MyVariable"] ''-- "getglobal()"''
 
_G["MyVariable"] = 1234 ''-- "setglobal()"''
 
Function calls always cost some overhead, so if a large number of getglobal calls are being made, the getfenv table will be a faster route. Note that for few or infrequent calls the performance gain of this method is negligible.
 

Revision as of 14:24, 31 October 2010

Template:Stub/Cataclysm

Inv weapon crossbow 02

Dark Ranger's Crossbow is a quest reward from Leader of the Pack.

Patch changes

Cataclysm Patch 4.0.3a (2010-11-23): Added

External links