IonicWind Software

IWBasic => General Questions => Topic started by: Andy on August 07, 2014, 02:36:53 AM

Title: Timer question
Post by: Andy on August 07, 2014, 02:36:53 AM
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.

Title: Re: Timer question
Post by: LarryMc on August 07, 2014, 07:37:21 AM
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()
Title: Re: Timer question
Post by: Andy on August 08, 2014, 06:37:25 AM
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.

:)