SortColNames

Declaration: TDataTable.SortColNames (Ascending, IgnoreCase: boolean; LowCol, LowRow, HighCol, HighRow: integer);
The method SortColNames sorts the data contained in the range [LowCol,LowRow] to [HighCol,HighRow], the column names, the column attributes, and the decimal place indicators according to the column names. The values outside this range are not affected. The parameter Ascending specifies whether the values are to be sorted in ascending (TRUE) or descending (FALSE) order. The parameter IgnoreCase controls whether lower and upper case letters are distinguished.

The sorting is performed by a modified bubble sort (CombSort), which has been reported to be comparable in speed to QuickSort (see also R.Box, S. Lacey, BYTE magazine, April 1991).

Hint: Setting both the low and high parameter of a dimension (i.e. LowCol and HighCol) to zero values forces the method to use all elements of that dimension.

Example: The statement MyDTable.SortColNames (true, 1, 1, MyDTable.NrOfColumns, MyDTable.NrOfRows) sorts the whole matrix MyDTable in ascending order according to the column names.


Last Update: 2020-Jšn-04