version 2004
SORT LISTBOX COLUMNS ({*; }object; colNum; order{; colNum2; order2; ...; colNumN; orderN})
Parameter | Type | Description | |
* | If specified, object is an object name (string) | ||
If omitted, object is a variable | |||
object | Form object | Object name (if * is specified) or | |
Variable (if * is omitted) | |||
colNum | Longint | Column number(s) to sort | |
order | > or < | > to sort in ascending order or | |
< to sort in descending order |
Description
The SORT LISTBOX COLUMNS command sorts the rows of the list box set in the object and * parameters on the basis of one or more column value(s).
If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a variable. In this case, you do not pass a string, but a variable reference. For more information about object names, refer to the Object Properties section.
In colNum, pass the column number of the column whose values you want to use as the sort criteria. You can use any type of array data, except pictures and pointers.
In order, pass the symbol > or < to indicate the sort order. If order contains the "greater than" symbol (>), the sort order is ascending. If order contains the "less than" symbol (<), the sort oder is descending.
You can define multi-level sorts: to do so, pass as many pairs (colNum;order) as necessary. The sorting level is defined by the position of the parameter in the call.
In conformity with the principle of list box operation, the columns are synchronized which means that the sorting of a column is automatically passed on to all the other columns of the object.