Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:Lua functions
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Table === These table functions are shorthand references to the Lua table library (which is available via "table.", see [http://lua-users.org/wiki/TableLibraryTutorial TableLibraryTutorial] for more info). Be also aware that many table functions are designed to work with tables indexed only with numerical indexes, starting with 1 and without holes (like {[1] = "foo", [3] = "bar"} --- recognize that [2] will be nil in this table). When working with any other tables behavior is not defined and might lead to unexpected results. Not being aware of this fact is one major causes for bugs in code written in Lua. : [[API foreach|foreach]](table,function) - Execute function for each element in table. (deprecated, used pairs instead) : [[API foreachi|foreachi]](table,function) - Execute function for each element in table, indices are visited in sequential order. (deprecated, used ipairs instead) : [[API getn|getn]](table) - Return the size of the table when seen as a list. This is deprecated, it is replaced by the # operator. Instead of table.getn(table), use #(table). : [[API ipairs|ipairs]](table) - Returns an iterator of type integer to traverse a table. : [[API pairs|pairs]](table) - Returns an iterator to traverse a table. : [[API sort|sort]](table[, comp]) - Sort the elements in the table in-place, optionally using a custom comparator. : {{api|tContains}}(table, value) - returns true if value is contained within table. This is not standard Lua, but added by Blizzard. : [[API tinsert|tinsert]](table[, pos], value) - Insert value into the table at position pos (defaults to end of table) : [[API tremove|tremove]](table[, pos]) - Remove and return the table element at position pos (defaults to last entry in table) : [[API wipe|wipe]](table) - Restore the table to its initial value (like tab = {} without the garbage). This is not standard Lua, but added by Blizzard.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)