Array_Sort (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved function sorts a range of elements in a dynamic array in either ascending or descending order..

Usage

Array_Sort(ArrayName, BegElementNum, EndElementNum, SortOrder);

Return

An integer value of 0 will be returned if the function is successful in setting the value else one of the following values will be returned:

-1 - Unknown error

-2 - Invalid ArrayName

-3 - BegElementNum or EndElementNum is out of range

-4 - SortOrder is invalid

Parameters

Name Description
ArrayName Identifies the source dynamic array containing elements to be sorted and is the name given in the array declaration
BegElementNum An integer representing the first element in the range of sorted values.
EndElementNum An integer representing the last element in the range of sorted values.
SortOrder An True/False value that specifies if the sort is Ascending(True) or Descending(False) .

Examples

Performs an ascending sort on the specified dynamic array from elements 1 through 5.

Value1 = Array_Sort(MyDynArray, 1, 5, True);