I think he means the highest value within an array. A multi-dimension array does not have "columns" as you may think. It is actually a matrix, so you will have to permatate each item like so:
VB Code:
Dim intArray(10, 20) As Integer Dim MeRandom As New Random For intIndex As Integer = 0 To intArray.GetUpperBound(0) For intInnnerIndex As Integer = 0 To intArray.GetUpperBound(1) intArray(intIndex, intInnnerIndex) = MeRandom.Next Next Next Dim intFoundOutter As Integer Dim intFoundInner As Integer Dim intCurrentHighestValue As Integer = -1 'Check through the entire set to find the highest value For intIndex As Integer = 0 To intArray.GetUpperBound(0) For intInnnerIndex As Integer = 0 To intArray.GetUpperBound(1) If intArray(intIndex, intInnnerIndex) > intCurrentHighestValue Then intCurrentHighestValue = intArray(intIndex, intInnnerIndex) intFoundOutter = intIndex intFoundInner = intInnnerIndex End If Next Next MessageBox.Show("Found highest number of " & intCurrentHighestValue.ToString & " at (" & intFoundOutter.ToString & "," & intFoundInner.ToString & ")")




Reply With Quote