Sort a table

Added by iNTERFACEWARE

Use table.sort() to sort the items within a table

Source Code
   -- sort numbers
   t = {3,2,1}
   table.sort(t)
   trace(t) 
   --> {1,2,3}
   
   -- sort characters
   t = {'c','b','a'}
   table.sort(t)
   trace(t) 
   --> {'a','b','c'} 
   
   -- sort characters
   t = {'3','2','1','c','b','a'}
   table.sort(t)
   trace(t) 
   --> {'1','2','3','a','b','c'}
   
   -- error cannot compare numbers and characters when sorting
   t = {3,2,1,'c','b','a'}
   table.sort(t)
Description
Use table.sort() to sort the items within a table