stopping an on-screen timer

Sarah Reichelt sarah.reichelt at gmail.com
Thu Jan 19 21:12:21 EST 2006


> What is the best way to display a timer on the screen and then have it
> stoppable?
>
> Something like the following would work for the timer
>
> on UpdateTimer
>    -- update the display
>    send UpdateTimer to me in 1 sec
> end UpdateTimer
>
> My question is how best to stop the timer?
>
> Is it better to look for the UpdateTimer message in the pendingMessages and
> cancel it?

I prefer the pendingMessages method and I don't store the ID of the
message and cancel that because I am never sure that catches all the
messages. So just loop through the pendingMessages cancelling any and
all that match your handler name.

Cheers,
Sarah



More information about the use-livecode mailing list