stopping an on-screen timer

Peter T. Evensen pevensen at siboneylg.com
Thu Jan 19 18:32:53 EST 2006


A button or other user action, i.e., hitting return in a field to enter an 
answer.  I just wasn't sure if using a global was the best solution.... I 
tend to dislike using globals.

At 05:00 PM 1/19/2006, you wrote:
>What triggers the stop?
>
>If it's a button, you could use a global easily enough:
>
>on mouseUp
>   global gTimerActive
>   put false into gTimerActive
>end mouseUp
>
>on UpdateTimer
>   global gTimerActive
>   --
>   -- update the display
>   --
>   -- also added a safety check here on the odd chance that
>   -- this routine is called more than once between updates;
>   -- with a one-second interval it's probably not needed,
>   -- but with short intervals it can be handy, and does no
>   -- harm if it's not needed:
>   if gTimerActive is not "false" \
>    AND "UpdateTimer" is not in the pendingMessages then
>      send "UpdateTimer" to me in 1 sec
>   end if
>end UpdateTimer

Peter T. Evensen
http://www.PetersRoadToHealth.com
314-629-5248 or 888-628-4588 




More information about the use-livecode mailing list