-- Sorting
-- Sorting
Following global constants are defined:
Following global functions are defined:
Sort the rows in a sequence according to a user-defined column order
Params:sequence of sequences to be sorted
list of columns indexes x is to be sorted by
this is sort_columns function from OpenEuphoria 4
A non-existent column is treated as coming before an existing column. This
allows sorting of records that are shorter than the columns in the
column list.
By default,
columns are sorted in ascending order. To ext_sort in descending
order, make the column number negative.
This function uses the "Shell" ext_sort algorithm.
This ext_sort is not "stable", i.e. elements that are considered equal might
change position relative to each other.
copy of the original sequence in sorted order
sequence dirlist
dirlist = dir("c:\\temp")
sequence sorted
-- Order is Size:descending, Name
sorted = sort_columns( dirlist, {-D_SIZE, D_NAME} )
compare(), ext_sort()