CompareArray()
Syntax
Result = CompareArray(Array1(), Array2() [, Flags])Description
Compare each elements of the two arrays for equality. Recursively compares also contents of structured arrays with dynamic elements (such as embedded arrays, lists or maps). The two arrays are considered the equal if they have the same type and dimensions and if each pair of elements is equal.
Parameters
Array1(), Array2() The arrays to compare. Flags (optional) Can be a combination of the following values: #PB_String_CaseSensitive : String comparison is case sensitive (a=a). (default) #PB_String_NoCase : String comparison is case insensitive(a=A). #PB_Memory_FollowPointers: If a structure element is a pointer that is not 0, recursively compare the pointer target. The default is to compare only the pointer value itself. See remarks below for details.
Return value
Returns nonzero if both arrays are the same or zero if they differ.
Remarks
The #PB_Memory_FollowPointers option is for advanced users and requires special care to avoid crashes. If this option is used then all pointer values must point to valid and initialized memory or have the value 0. It is also not allowed to have loops in the pointed elements (a chain of pointers that refers back to itself).
Example
Dim A(4) A(0) = 10 A(1) = 20 A(2) = 30 A(3) = 40 Dim B(4) B(0) = 10 B(1) = 20 B(2) = 50 ; Not equal to A(2) B(3) = 40 Debug CompareArray(A(), B()) ; Not equal
See Also
CompareList(), CompareMap()
Supported OS
All