ClassSystem.Array SyntaxDim result As Integer = Array.IndexOf(array, _ value[, startIndex[, count]])
DescriptionThe IndexOf method returns the index of the first occurrence of value in array, or -1 if value was not found within the range searched. Usage at a Glance
ExampleThe following code searches for a value in an Integer array: Dim counter As Integer Dim dataSet(99999) As Integer For counter = 0 To 99999 dataSet(counter) = CInt(Rnd( ) * 100000) Next counter MsgBox(Array.IndexOf(dataSet, 36500)) See AlsoArray Class, Array.LastIndexOf Method |