Sorts the elements in a one-dimensional array or the rows in a two-dimensional array, returning 1 if successful or an error if unsuccessful.

Syntax

ASORT(<array name>
[, <starting element expN> [,<elements to sort expN>
[, <sort order expN>]]])

<array name>

A declared one- or two-dimensional array.

<starting element expN>

In a one-dimensional array, the number of the element in <array name> at which to start sorting. In a two-dimensional array, the number (subscript) of the column on which to sort. Without <starting element expN>, ASORT( ) starts sorting at the first element or column in the array.

<elements to sort expN>

In a one-dimensional array, the number of elements to sort. In a two-dimensional array, the number of rows to sort. Without <elements to sort expN>, ASORT( ) sorts the rows starting at the row containing element <starting element expN> to the last row. If you want to specify a value for <elements to sort expN>, you must also specify a value for <starting element expN>.

<sort order expN>

The sort order:

0 specifies ascending order (the default)

1 specifies descending order

If you want to specify a value for <sort order expN>, you must also specify values for <elements to sort expN> and <starting element expN>.

Description

See the description for sort( ).