SORTDATA()

SORTDATA()

Top  Previous  Next

 

The SORTDATA() function returns the data elements from a sort.

 

 

Format

 

SORTDATA(sort.var, {max.items})

 

where

 

sort.varis a sort variable created by a previous use of SORT().

 

max.itemsis the maximum number of items to be returned. If omitted or less than one, all data is returned.

 

 

The SORTDATA() function is intended as an alternative to a loop containing a SORTNEXT() function where no processing of the individual items is required. It returns the data associated with sorted items as a field mark delimited dynamic array. If the sort does not include a data element, the first key value for each entry is returned.

 

The max.items argument limits the number of items returned. A further use of SORTDATA() will return subsequent items from the sort.

 

 

See also:

Sorting, SORT(), SORTADD, SORTCLEAR, SORTNEXT()