Poll. the Timer?

jransom2

Member
Licensed User
Longtime User
Is there a way to poll the timer function?

Suppose you have a timer set for 30 seconds, is there a way to poll the timer for a count down that can be thrown to a label before the timer_tick function?

Or is there a way to do this for multiple timers at the same time that I have not thought of?

Thanks
 

rbsoft

Active Member
Licensed User
Longtime User
You could set the timer for 1 second and count down a global var. Execute your code when zero is reached.

B4X:
Sub Timer1_Tick
   CountDown = CountDown -1
   lblCountdown.Text = CountDown
   If CountDown = 0 Then
      ToastMessageShow("Bingo",True)
      CountDown = 30
   End If
End Sub

Small project is attached.

Rolf
 

Attachments

  • TimerCountdown.zip
    6.6 KB · Views: 317
Upvote 0
Top