WoW:API sort: Difference between revisions

6 bytes removed ,  25 March 2010
{{luaapi}}
(Alphabetically sort table function)
({{luaapi}})
Line 1: Line 1:
{{:Lua/Libshortcut|sort|table.sort}}
{{luaapi}}
From [http://lua-users.org/wiki/TableLibraryTutorial TableLibraryTutorial] of lua-users.org.
From [http://lua-users.org/wiki/TableLibraryTutorial TableLibraryTutorial] of lua-users.org.


  table.sort(table [, comp])
  table.sort(table [, compFunc])
sort(table[, compFunc])


Sort the elements of a table in-place (i.e. alter the table).
Sort the elements of a table in-place (i.e. alter the table).
Line 61: Line 62:


This will print all the variables in randomtable alphabetically!
This will print all the variables in randomtable alphabetically!
{{LUA}}