WoW:API GetBagName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
----
----
;''Arguments''
;''Arguments''
:;:(bag)
:;:(bagID)
:::;bag : number - number of the bag the item is in, 0 is your backpack, 1-4 are the four additional bags, numbered left to right.
:::;[[API TYPE bagID|bagID]] : number - number of the bag the item is in, 0 is your backpack, 1-4 are the four additional bags, numbered right to left.


----
----
Line 19: Line 19:
;''Result''
;''Result''


: bagName will contain the name of the specified bag if the bag number is 0-4 otherwise it will be nil.
: bagName will contain the name of the specified bag if the bag number is 0-4 otherwise it will be nil, unless when the bank is opened, in which case GetBagName(-1) (for the bank) is nil and GetBagName(6) will give the name of the first bank bag, GetBagName(7) the name of the second bank bag, etc ...


----
----
{{WoW API}}
{{WoW API}}

Revision as of 23:57, 14 March 2006

GetBagName -Documentation by Arvenis-

Arguments
(bagID)
bagID
number - number of the bag the item is in, 0 is your backpack, 1-4 are the four additional bags, numbered right to left.

Returns
bagName
bagName - the name of the specified bag (example "Green Woolen Bag")

Examples
local bagName = GetBagName(0);  
--Returns "Backpack"

Result
bagName will contain the name of the specified bag if the bag number is 0-4 otherwise it will be nil, unless when the bank is opened, in which case GetBagName(-1) (for the bank) is nil and GetBagName(6) will give the name of the first bank bag, GetBagName(7) the name of the second bank bag, etc ...

Template:WoW API