Sub Globals
Dim Cycler as timer
End Sub
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim appactive As Boolean
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")
Dim btn1,btn2 As Button
btn1.Initialize("btn1")
btn2.Initialize("btn2")
Activity.AddView(btn1, 10dip, 10dip, 100dip, 100dip)
Activity.AddView(btn2, 110dip, 110dip, 100dip, 100dip)
btn1.Text="1"
btn2.Text="2"
appactive = True
Cycler.Initialize("cycler", 200)
Cycler.Enabled = True
End Sub
Sub btn1_Click
'Msgbox("bye","")
appactive = False
End Sub
Sub Cycler_Tick
If appactive then
Log("...") ' log works fine
DoEvents
end if