Works in IDE but not the iOS simulator

Bill Vlahos bvlahos at mac.com
Sat Oct 15 22:32:03 CDT 2011


Katsuyuki Katayama has a nifty Timer sample program in RevOnline. It is a stopwatch program that lets you start and stop the timer.

In the IDE the start button and stop buttons work as expected. However, in the iOS Simulator you can start it but you can't stop it.

Why?

Here is the code from the "start" button.
on mouseUp
   put empty into Bigin
   put empty into Now
   put empty into Timer
   put empty into field "Time"
   put empty into count

   if the hilite of button "start"  is true
   then
      set the hilite of button "stop"  to false
   end if
   
   get the seconds
   put it into Bigin
   
   repeat while the hilite of button "start" is true
      get the seconds
      put it into Now
      put Now - Bigin into Timer
      put Timer into field "Time"
      wait for 100 milliseconds

       if the mouseClick
      --the hilite of button "stop" is true
       then
          exit repeat
          --set the hilite of button "start" to false
       end if
   end repeat
end mouseUp


Here is the code from the "stop" button
on mouseUp
      if the hilite of button "stop"  is true
   then
      set the hilite of button "start"  to false
   end if
end mouseUp

Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.




More information about the use-livecode mailing list