Microsoft Small Basic

Program Listing: LPX272
GraphicsWindow.Title = "Text Challenge 2 - November 2012 (Graphic Version with Button)
GraphicsWindow.Width = 728
GraphicsWindow.Height = 500
GraphicsWindow.Top = 0
GraphicsWindow.Left = 0
GraphicsWindow.BackgroundColor = "OrangeRed"
GraphicsWindow.BrushColor = "Black"
Resp = Controls.AddTextBox(189, 20)
Controls.SetSize(Resp, 300, 25)
GraphicsWindow.BrushColor = "Red"
Enter = Controls.AddButton("Enter", 489, 20)
Controls.SetSize(Enter, 50, 25)
GraphicsWindow.BrushColor = "White"
Controls.ButtonClicked = OnButtonClick
question=1
Do_question()

Sub Do_question
If question =1 Then
GraphicsWindow.DrawText(0,60 "1. Welcome, What is your name?")
Sound.PlayClick()
ElseIf Question= 2 then
GraphicsWindow.DrawText(0,80 "2. Hello, " + UserAns[1] + "! How are you? [Great, Good, or Bad]")
Sound.PlayClick()
elseif Question= 3 then
If UserAns[2] = "great" Then
GraphicsWindow.DrawText(0,100 "_ That's awesome to hear!")
ElseIf UserAns[2] = "good" Then
GraphicsWindow.DrawText(0,100 "_ That's good to hear!")
ElseIf UserAns[2] = "bad" Then
GraphicsWindow.DrawText(0,100 "_ I am sorry to hear that!")
Else
GraphicsWindow.DrawText(0,100 "_ Sorry! I don't follow?")
EndIf
GraphicsWindow.DrawText(0,120 "3. What is your hobby, " + UserAns[1] + "?")
Sound.PlayClick()
elseif UserAns[3]<>"" then
TextWindow.Write(UserAns)
endif
endsub

Sub OnButtonClick
UserAns[question] = Controls.GetTextBoxText(Resp)
Controls.SetTextBoxText(Resp, "")
question = question+1
Do_question()
EndSub