Finding Equal Values

Kris Jacyna

Member
Joined
Feb 12, 2007
Messages
20
Programming Experience
Beginner
Say I have an array Numbers(5),
is there a quick way to see if the values for each index are the same?
E.g. if they all equal to 1, or any variable number

thanks,

Kris
 
Dim Number() As Integer = new Number() {}
Dim j AsInteger = 1


'Arrays begin at zero so check from 0 to the upperbound (or last index)
For i As Integer = 0 To Number.GetUpperBound(0)
'if it is equal then do... what?
If j = number.GetUpperBound(i) Then
MsgBox("True")
EndIf
Next
 
Back
Top