08-24-2012, 02:10 AM
Code:
Function CompareArrays(arrArray1, arrArray2)
Dim intA1
Dim intA2
Dim blnMatched
' check that the arrays are the same size
If UBound(arrArray1) <> UBound(arrArray2) then
' arrays are different size, so return false and exit function
CompareArrays = False
Exit Function
End if
' for each element in the first array
For intA1 = LBound(arrArray1) to UBound(arrArray1)
' initialise this to false
blnMatched = False
' for each element in the second array
For intA2 = LBound(arrArray2) to UBound(arrArray2)
' compare the content of the two arrays
If arrArray1 (intA1) = arrArray2 (intA2) Then
blnMatched = True
Exit For
End If
Next ' next element in second array
' if the element was not found in array two, return false and exit function
If Not blnMatched then
CompareArrays = False
print"fail"
Exit Function
End If
Next ' next element in first array
' if the function got this far, then the arrays contain the same data
If CompareArrays = True then
print "PASS"
else
Print "FAIL"
End if
End Function ' CompareArrays
I am using the above function for it but not working properly.
Suggestions