Equinox Online Help - Language Reference - A to Z
ArraySort |
|
|---|---|
| Applies to | ![]() |
| Syntax | ArraySort vector [,column, flags, comparison, start, len] |
| Action | (Statement) Sorts an array according to parameters set. |
| Scope | Usable anywhere |
| Notes | VectorExpression may contain an array name or any vector expression. If it contains two or more dimensions, the other columns in the last dimensions may optionally be moved with the sorted data. For this purpose, arrays of more than two dimensions are combined, for example, [2][3][4] would be treated as 6 sortable vectors of 4 elements each. ColumnExpression parameter specifies which column to sort the array, defaulting to 1. FlagsExpression may have the following values:
ComparisonExpression may have the following values:
StartExpression specifies the beginning of the comparison item inside a string, defaulting to 1. LengthExpression specifies the length of the comparison item, defaulting to the length of the rest of the string. StartExpression and LengthExpression are ignored for types other than string. This statement does not preserve the original order of the array where a number of elements have the same value. If you wish to do this you will need to ensure that no elements have duplicate values. |
| Category | Arrays |
| See Also | ArrayFind, ArrayFindNext, ArrayGetDimensions, ArraySearch, ArraySearchNext, ArraySetDimensions, ArrayNeg, ArrayNot, Vector, VectorSize |
| Example | This example sorts a two dimensional numeric array into descending order on the second column, and moves the first column with the sorted data ArraySort n, 2, 1 |
