B4R Question Timer firing when enabled, not when timer ticked

NoNickName

Member
Licensed User
I don't know whether this is by design or by chance. I want a timer to fire an event after 1 hour it has been enabled.
Unfortunately, as soon as I enable the timer, the event is fired, and again once after the tick elapsed.
Is it by design, and if so, how to prevent this to happen?
 

janderkan

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Process_Globals
    Public tim As Timer
    Private JustStarting As Boolean = False  
End Sub

Private Sub AppStart
    tim.Initialize("tim_Tick",1000)
    tim.Enabled=True
End Sub

Sub tim_Tick
    If JustStarting Then
        JustStarting=False
        Return  
    End If
End Sub
 
Upvote 0
Top