table.sortdesc
From GMod Wiki
Revision as of 07:27, 26 September 2009 by Unrealomega (Talk | contribs)
Function | |
Syntax |
table.sortdesc( Table table ) Where is this used? |
Description: | |
Sorts a Table into descending alphabetical order. | |
Returns: | nil |
Part of Library: | Table |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Table.sortdesc]Table.sortdesc [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Sort the values of a Table . |
---|---|
Used on | |
Code | local tbl = {"b", "a", "c", "e", "d"} table.sortdesc( tbl ); // Table is now: {"e", "d", "c", "b", "a"} // This function does the same exact thing as this: table.sort( tbl, function(a, b) return a > b end ); |
Output | Prints a Table in descending alphabetical order into the console. |