Array Functions
The following functions can be used for arrays.
Name | Description | |||||||||||||||||||||||||||||
SORT |
Sorts a 1 to 6 dimensional array or a number of within such an array in ascending or descending order. The parent structure(s) may not be arrays. If <No. of elements> is not specified, AMT will take the last filled element. An element is empty if these only contain spaces or zeroes. Any combination of spaces and zeroes is regarded as empty. If a SORT is executed on a structure, then the sorting will be based on the value in the structure (alpha), disregarding the sub fields. This particularly influences the behavior for financial and computational subfields.
|
|||||||||||||||||||||||||||||
ExamplesFilling the array:
saa-5[1] := 'ii'
saa-5[2] := '99' saa-5[3] := 'ee' saa-5[4] := 'cc' saa-5[5] := 'aa' // the contents of saa-5[] is now 'iiggeeccaa' The same array after a sort ascending:
saa-5.sort(asc)
// the contents is now 'aacceeggii' The same array after a sort with no. of elements. As you can see it only sorted the first 3 elements in ascending order:
saa-5.sort(asc, 3)
// the contents is now 'eeggii' In a multi dimensional array, only the deepest dimension will be sorted and AMT will search every time for the number of elements. Filling the array:
saa-23[1, 1] := 'dd'
saa-23[1, 2] := 'aa' saa-23[2, 1] := 'ee' saa-23[2, 2] := 'cc' // the contents of saa-23[] is now 'ddaa eecc' After sorting:
saa-23.sort (asc)
// the contents is now 'aadd ccee' |
||||||||||||||||||||||||||||||
FIND |
Searches the <Value> in the array. If a 1 dimensional array is concerned, then the result will be an integer, indicating the element within the array that holds the searched <Value>.
|