Syntax
Sort <listvar> [Ascending|Descending]Description
Sort re-orders the items in a list or a table associated with a list to be in ascending or descending alphabetical order.Parameters
<listvar>
- A variable containing the list to be sorted. Note that this may not be a literal string, e.g., "a,b,c". If <listvar> has been associated with a table using the Table statement, all the other columns (i.e., lists) in the table will be reordered so that the rows of the table remain intact. That is, the table rows will be sorted according to the values in the specified list.
Ascending|Descending
- Optional. Specifies whether the sort order is to be ascending (the default) or descending. The characters A,B,C are in ascending order, while the characters C,B,A are in descending order.
Remarks
Example
aList = "Gray,Green,Black"
Sort aList AscendingThe above script line sorts the list aList into ascending alphabetical order (i.e., Black,Gray,Orange).