Hi,
I didnt understand what exactly u want, but i made u this code, hope this will help you.
Code:
Dim ARRAY1 As Int16() = {2, 3, 5, 6, 7}
Dim ARRAY2 As Int16() = {4, 2, 1, 3, 5}
Dim I As Int16
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Array_compare(ARRAY1, ARRAY2) Then
MsgBox("Arrays r equal")
Else
MsgBox("Arrays not equal")
End If
End Sub
Private Function Array_compare(ByVal arr1 As Int16(), ByVal arr2 As Int16()) As Boolean
For I = 0 To arr1.GetUpperBound(0)
If arr1(I) <> arr2(I) Then
Return False
'return false when it just find one item not equal
End If
Next
'returns true only if all items are equal
Return True
End Function
Bookmarks