table.SortByKey
Example
Example usage of the function.
local t = {}
t['h'] = 2 -- Lowest value
t['a'] = 150 -- Highest value
t['x'] = 30
PrintTable( table.SortByKey( t ) )
PrintTable( table.SortByKey( t , true ) )
Output:
1 = a
2 = x
3 = h
1 = h
2 = x
3 = a