Hello,
I am new to VB I get this error message "Conversion from string "" to type 'Double' is not valid. when running my app, (the underline codes are the errors). which is a basketball simulator. How can I correct this; Thank you so much for taking the time to review this.
I am new to VB I get this error message "Conversion from string "" to type 'Double' is not valid. when running my app, (the underline codes are the errors). which is a basketball simulator. How can I correct this; Thank you so much for taking the time to review this.
Code:
Private Sub playButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles playButton.Click
Dim rank As Integer
Dim player As Integer
Dim shoots As Integer
Dim RandomGenerator As New Random
Dim isConverted As Boolean
Dim I As Integer = 0
'generate random player from visitor 6-10, home 1-5
player = RandomGenerator.Next(1, 11)
Label84.Text = CStr(RandomGenerator.Next(1, 101))
For I = 0 To 4
Select Case player
Case 1
Label1.Text = "Home Player 1 Selected"
If TextBox6.Text < TextBox90.Text And Label84.Text < TextBox66.Text Then
TextBox30.Text = +1[U] And CDbl(TextBox25.Text) = +1 [/U]And CDbl(TextBox20.Text) = +2
Else
TextBox45.Text = +1[U] And CDbl(TextBox39.Text) = +1[/U] And CDbl(TextBox35.Text) = +2
End If
Case 2
Label1.Text = "Home Player 2 Selected"
If TextBox7.Text < TextBox9.Text And Label84.Text < TextBox12.Text Then
TextBox29.Text = +1 [U]And CDbl(TextBox24.Text) = +1 [/U]And CDbl(TextBox19.Text) = +2
Else
TextBox44.Text = +1 [U]And CDbl(TextBox39.Text) = +1[/U] And CDbl(TextBox34.Text) = +2
End If
Case 3
Label1.Text = "Home Player 3 Selected"
If TextBox8.Text < TextBox88.Text And Label84.Text < TextBox78.Text Then
TextBox28.Text = +1 [U]And CDbl(TextBox23.Text) = +1 [/U]And CDbl(TextBox18.Text) = +2
Else
TextBox43.Text = +1 [U]And CDbl(TextBox38.Text) = +1[/U] And CDbl(TextBox33.Text) = +2
End If
Case 4
Label1.Text = "Home Player 4 Selected"
If TextBox9.Text < TextBox81.Text And Label84.Text < TextBox77.Text Then
TextBox27.Text = +1 [U]And CDbl(TextBox22.Text) = +1[/U] And CDbl(TextBox17.Text) = +2
Else
TextBox42.Text = +1 [U]And CDbl(TextBox37.Text) = +1[/U] And CDbl(TextBox32.Text) = +2
End If
Case 5
Label1.Text = "Home Player 5 Selected"
If TextBox10.Text < TextBox86.Text And Label84.Text < TextBox76.Text Then
TextBox26.Text = +1 [U]And CDbl(TextBox22.Text) = +1 [/U]And CDbl(TextBox17.Text) = +2
Else
TextBox41.Text = +1[U] And CDbl(TextBox36.Text) = +[/U]1 And CDbl(TextBox31.Text) = +2
End If
Comment