Sort - method of object PmDataTable

The method sorts rows by values in the specified column (the sort always relocates the whole row). The sort can be ascending or descending.
Sort(SortType As Long, vCol As Variant) As Boolean
oDataTable.Sort SortType, vCol
SortType(Long) Sort type:
0 - ascending (01..89..AB..YZ..ab..yz)
1 - descending (
vCol(Variant) Identification of the column where rows have to be sorted. It must be of the String type or the integer.

If it is the String, then it is the name of the column.

If it is the integer >=0, then it is the column index (zero-based index), -2 means the last column.

Return Values:
Returns true if a sort occurred, false if no sort occurred (e.g. wrong entered parameters).

If there are more rows (>1000), then the sort can take non-negligible time. The sort is convenient only in the column with values of the same data type (only numbers, texts, logical or time values).

If the request to sort is, for example, by the column 1 and the values equal, then by the column 2, this can be realized by two calling of the Sort method: at first to sort by the column 2 and then by the column 1.

"Read only" columns: If any cell is locked in "Read only" column by writing non-empty value the the whole structure of the table is locked. Then it is no longer possible to add or remove rows or columns or change the structure of the table. The structure and dimensions of the table must be defined and modified before writing first non-empty value into a cell in "Read only" column.

Sort the fifth column (zero-based index) ascending:
oDataTable.Sort 0, 5
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice