Well I figured out how to do my program but I recieve this error in this part of my code
Here is my code
Any help wouldbe great!
Code:
If Lotto(count) = UserNum Then ' check to see if number match
And I dont know what it means.Operator '=' is not defined for Integers or 1 dimmensonal arrays of Integers
Here is my code
Code:
Dim Lotto(4) As Integer
Dim UserNum(4) As Integer
Dim count As Integer
Dim NumMatch As Integer
Sub GetNum()
For count = 0 To 4
UserNum(count) = Val(InputBox("Please enter a number for lotto number ", "lotto Number" & _
(count + 1).ToString))
Next count
End Sub
Sub Random5Numbers()
Randomize() 'Initializes the random-number generator.
For count = 0 To 4 'Puts the 5 numbers into the Array
Lotto(count) = Int(0 + Rnd() * (9 - 0))
Next count
'Show the five numbers on a textbox, just for testing...
'MessageBox.Show(Lotto(0) & ";" & Lotto(1) & ";" & Lotto(2) & ";" & Lotto(3) & ";" & Lotto(4))
End Sub
Sub CheckNum()
If Lotto(count) = UserNum Then ' check to see if number match
NumMatch = NumMatch + 1 ' if they do, then add 1 to the count of numbers matched
End If
lblDisplay.Text = NumMatch
End Sub
Any help wouldbe great!