May 03, 2024, 01:17:54 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Timer question

Started by Andy, August 07, 2014, 02:36:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

I start a timer:

STARTTIMER win,8000 (8 seconds)

But the program then waits 8 seconds before it runs the sub routine in the @timer section of the
handler.

Why does it wait 8 seconds? and is there a way to start it immediately (or near enough) and then repeat every 8 seconds?

Thanks,
Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

whatever the timer is doing every 8 seconds you need to put in a subroutine.
then, when you do this
STARTTIMER win,8000 immediately execute
timersub()
and then in your @TIMER handler execute
timersub()
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Thanks Larry,

Tested and working, sometimes you can miss the wood for the trees.
In other words, you can look to deeply at a problem when the answer is really simple.

Thanks again,
Andy.

:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.