'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Btn_Action As Button
Dim edt_Result As EditText
Dim LblComments As Label
Dim lblMathSign As Label
Dim lblNumber1 As Label
Dim lblNumber2 As Label
Dim Number1, Number2 As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
New
End Sub
Sub New
Number1 = Rnd(1, 10)
Number2 = Rnd(1,10)
lblNumber1 = Number1
lblNumber2 = Number2
LblComments.Text="Enter the Result" & CRLF & "Click on OK"
edt_Result = ""
End Sub
Sub btnAction_Click
If Btn_Action.Text = "O K" Then
If edt_Result.Text = "" Then
Msgbox(" No result Entered", "E R R O R")
Else
Check_Result
End If
End If
End Sub
Sub Check_Result
If edt_Result.Text = Number1 + Number2 Then
LblComments.Text = "G O O D Result" & CRLF & "Click on New"
Btn_Action = "N E W" '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Else
LblComments.Text = "B U M M E R" & CRLF & "Enter a new result" & CRLF & "and Click OK"
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Btn_Action_Click
End Sub