DecoratorFawn82
Member
Hey there! Have just beginned with B4A and I am trying to code a quiz game but the CallSub function didn't worked or I do not know how to use it my code looks like this:
:sign0085:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
#End Region
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 CheckBox1 As CheckBox
Dim CheckBox2 As CheckBox
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Msgbox("Welcome to Kevin's First application!", "Kevin's Application")
Activity.LoadLayout("Layout1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
Else
CheckBox1.Checked = True
Msgbox("The quiz has begun!", "Started Quiz")
CallSub(Module1, "GoToNextWindow")
End If
If CheckBox2.Checked = True Then
CheckBox2.Checked = False
End If
CallSub(Module1, "RefreshData")
End Sub
Sub Button2_Click
If CheckBox2.Checked = True Then
CheckBox2.Checked = False
Else
CheckBox2.Checked = True
Msgbox("You where not ready to start quiz", "User Not Ready")
End If
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
End If