stopping an on-screen timer

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Jan 20 08:56:47 EST 2006


Hi Peter,

As  for me I use a simple custom property and not a global:

on StartTimer
   set the uStopTimer of this cd  to false
   UpdateTimer #
end StartTimer
---------------------------
on StopTimer
   set the uStopTimer of this cd  to true
end StopTimer
---------------------------
on UpdateTimer
   <statements>
   if not the uStopTimer of this cd and "UpdateTimer is not in the  
pendingMessages then
     send "UpdateTimer" to me in <delay>
   end if
end UpdateTimer

Then in any script:
   StopTimer #

Le 19 janv. 06 à 23:35, Peter T. Evensen a écrit :

> 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?
> Have a global variable indicating the timer is active and only send  
> the UpdateTimer to me if it is active?
>
> What have other people used?

Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list