Array_Compare (Reserved Word)
This reserved function compares a range of elements between the first and second dynamic array and returns an integer value identifying any differences.
Usage
Array_Compare(SrcArrayName, SrcElement, DestArrayName, DestElement, NumElements);
Return
A value of 0 will be returned if all respective elements in the range of NumElements for both arrays are equal. If they are not, the following values will be returned:
1 A value in the range of SrcArrayName is greater than its counterpart in DestArrayName.
-1 A value in the range of SrcArrayName is less than its counterpart in DestArrayName.
-2 An error has occurred in the comparison (incompatible array types, Out of Bounds range error, etc.).
Parameters
Name | Description |
SrcArrayName | Name that identifies the first dynamic array to compare and is the name given in the array declaration. |
SrcElement | An integer representing the starting element to begin comparing in the first array. |
DestArrayName | Name that identifies the second dynamic array to compare with and is the name given in the array declaration. |
DestElement | An integer representing the starting element to begin comparing in the second array. |
NumElements | An integer representing the number of elements to compare. |
Examples
Compares a range of 6 array elements starting with element 4 of the first dynamic array to element 5 of a second dynamic array.
Array_Compare(FirstArray, 4, SecondArray, 5, 6);