Option Explicit
Private strGender As String
Private strYourName As String
Private strYourGender As String
Private intAge As Integer
Private Sub cmdStart_Click()
Select Case intAge
Case Is < 12
strGender = InputBox("Do you want to talk to a boy or girl?", "Entry")
Case Is > 12
strGender = InputBox("Do you want to talk to a male or female?", "Entry")
End Select
lblAIGender.Caption = strGender
DoInit
End Sub
Private Sub DoInit()
rtfAI.Text = rtfAI.Text & "Hello, what is your name?"
strYourName = InputBox("What is your name?", "Entry")
Select Case intAge
Case Is < 12
strYourGender = InputBox("Are you a boy or girl?", "Entry")
Case Is > 12
strYourGender = InputBox("What is your gender?", "Entry")
End Select
End Sub
Private Sub Form_Load()
If strGender = "" Then
lblAIGender.Caption = "Unknown"
Else
Exit Sub
End If
Randomize
intAge = CInt(Int((90 * Rnd()) + 1))
lblAIAge.Caption = intAge
End Sub
Private Sub rtfAI_GotFocus()
txtOut.SetFocus
End Sub