Valid on UNIX and Windows
The SortArray function sorts an array.
Function format:
SortArray(array as array) as Boolean
SortArray(array as array, start as integer) as Boolean
SortArray(array as array, start as integer, end as integer) as Boolean
Identifies the name of the array to be sorted.
Specifies the start index for the sort. The array is sorted from the start index to the end of the array.
Specifies the last index for sort.
The function only handles basic types of arrays. Depending on the format chosen, (1) the whole array is sorted, (2) the array is sorted beginning with the start index, and (3) the array is sorted from the start index to the end index.
On successful completion, the function returns TRUE; otherwise, returns FALSE.
Example:
Dim a[10], b[10], i As Integer
Dim TAB As Char
TAB = chr(9)
For i=0 to 9
a[i] = 10 - i
Next i
b = a
If SortArray(b) Then
For i = 0 To 9
Print("a("+Str(i)+")="+Str(a[i])+TAB+"b("+Str(i)+")="+Str(b[i]))
Next i
Else
Print("SortArray(b) failed!")
End If
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|