hey guys, me again.attempt number 2 on trying to get to the bottom of these arrays.
i'm trying to display the highest number in an array and i am using the following code. can anyone tell me why it keeps giving me a result of zero. i have been searching through the forum and this was basically what i came out with.
(I can fill the array as i have a button that displays the numbers inputted into the array)
VB Code:
Private Sub cmdHighest_Click() Dim Highest As Integer Dim Numbers(1 To 5) As Integer For Index = 1 To UBound(Numbers) If Numbers(Index) > Highest Then Highest = Numbers(Index) End If Next Index lblHighest.Caption = Highest End Sub




attempt number 2 on trying to get to the bottom of these arrays.
i'm trying to display the highest number in an array and i am using the following code. can anyone tell me why it keeps giving me a result of zero. i have been searching through the forum and this was basically what i came out with.
Reply With Quote