` Printed Icetips Article

Icetips Article



Par2: Cascading multiple timers
1998-08-01 -- Owen Brunker
 
>In this case, it could not work because the timer event may only be
executed
>every minute or so.

A technique that may be useful to you is one that I use for cascading
multiple timers from the window timer.

Window    WINDOW,TIMER(10)
                        .
                        .
                    END

  CODE

                   .
                   .

    OF EVENT:Timer
            TimeNow1 = CLOCK()
            IF TimeNow1 < TimeLastEvent1 THEN TimeNow1 += 24 Hours.
            IF TimeNow1 > TimeLastEvent1 + TimerInterval1
                    DO DoSomething1
            END

            TimeNow2 = CLOCK()
            IF TimeNow2 < TimeLastEvent2 THEN TimeNow2 += 24 Hours.
            IF TimeNow2 > TimeLastEvent2 + TimerInterval2
                    DO DoSomething2
            END
            IF KEYBOARD()
                    DO KeyboardStuff
            END

This will only work on a window where there are no controls requiring
keyboard entry.



Printed May 3, 2024, 3:30 am
This article has been viewed/printed 35110 times.