Function ASort() Foundation
Sorts the elements of an array.
ASort( <aArray>, [<nStart>], [<nCount>], [<bOrder|lOrder>] ) --> aArray
The return value of ASort() is a reference to <aArray>.
The array function ASort() sorts the elements of an array. One dimensional arrays are sorted in ascending order by default. This means that smaller values are placed at the beginning of the array, with larger values at the end. Sorting in descending order or sorting multi-dimensional arrays requires that a code block be specified. The code block must contain a logical expression comparing two values. Two values x1 and x2 are passed to the code block from ASort(). To create ascending order, the code block must return the result of evaluating whether x1 < x2. To create descending order, the code block must return the result of evaluating whether X1 > X2.
Character strings are sorted according to their lexical order. Sorting depends on the settings SET EXACT, SET LEXICAL and SET COLLATION. Logical values are sorted with .F. (false) being less than .T. (true). Date values are sorted chronologically and numeric values according to their size.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.