Navigation menu

WoW:API UnitName: Difference between revisions

Jump to navigation Jump to search
no edit summary
(→‎Details: Notes on the second return value)
No edit summary
Line 44: Line 44:


* The '''realm''' return will be nil even if the player is from a different realm, if it is out of visible range.
* The '''realm''' return will be nil even if the player is from a different realm, if it is out of visible range.
 
* Realm name will not include server type


* Note that this function always returns two values even though the latter may be nil. The difference is usually moot, but there are some cases where it matters, e.g. <span style="white-space: nowrap;"><tt>tinsert(myTable, UnitName("player"))</tt></span>, which would previously work, but will now cause errors. The fix is to put the expression in parenthesis: <span style="white-space: nowrap;" ><tt>tinsert(myTable, (UnitName("player")) )</tt></span>.
* Note that this function always returns two values even though the latter may be nil. The difference is usually moot, but there are some cases where it matters, e.g. <span style="white-space: nowrap;"><tt>tinsert(myTable, UnitName("player"))</tt></span>, which would previously work, but will now cause errors. The fix is to put the expression in parenthesis: <span style="white-space: nowrap;" ><tt>tinsert(myTable, (UnitName("player")) )</tt></span>.


[[Category:World of Warcraft API]]
[[Category:World of Warcraft API]]
Anonymous user