Can someone help me starting with basic4ppc.
I have used the starting program number-guessing. I want to make a second screen with other questions but I can not start it. It stops after the original program. How do I close the form1 and start up the form2?
Sub Globals
'Declare the global variables here.
Dim number
End Sub
Sub App_Start
Form1.Show
number = Rnd (1,3)
End Sub
Sub btnGuess_Click
If Not (IsNumber(txtnumber.Text)) Then
Msgbox("Een juist nummer invoeren svp")
Return
End If
If txtnumber.Text > number Then
Msgbox("Een kleiner nummer")
Else If txtnumber.Text < number Then
Msgbox ("Mijn nummer is groter")
Else
If Msgbox ("Het juiste nummer!" & crlf & "Opnieuw?","",cmsgboxYesNo) = cYes Then
number = Rnd(1,3)
Else
form1.Close
End If
End If
txtnumber.Focus
txtnumber.SelectionStart = 0
txtnumber.SelectionLength = StrLength(txtnumber.Text)
End Sub
Sub key_Click
Form2.Show
number = Rnd (1,3)
End Sub
I have used the starting program number-guessing. I want to make a second screen with other questions but I can not start it. It stops after the original program. How do I close the form1 and start up the form2?
Sub Globals
'Declare the global variables here.
Dim number
End Sub
Sub App_Start
Form1.Show
number = Rnd (1,3)
End Sub
Sub btnGuess_Click
If Not (IsNumber(txtnumber.Text)) Then
Msgbox("Een juist nummer invoeren svp")
Return
End If
If txtnumber.Text > number Then
Msgbox("Een kleiner nummer")
Else If txtnumber.Text < number Then
Msgbox ("Mijn nummer is groter")
Else
If Msgbox ("Het juiste nummer!" & crlf & "Opnieuw?","",cmsgboxYesNo) = cYes Then
number = Rnd(1,3)
Else
form1.Close
End If
End If
txtnumber.Focus
txtnumber.SelectionStart = 0
txtnumber.SelectionLength = StrLength(txtnumber.Text)
End Sub
Sub key_Click
Form2.Show
number = Rnd (1,3)
End Sub