I'm writing a little app that requires multiple timers on the same card. This is the code i have in a 'Start' button:
Code: Select all
local tMin1, tSec1
on mouseUp
   if the label of me is "Start" then
      set the label of me to "Stop"
      put 0 into tMin1
      put 0 into tSec1
      repeat while the label of me is "Stop"
         wait 1 second with messages
         add 1 to tSec1
         if tSec1 < 60 then
            if tSec1 <= 9 then
               put "0" & tSec1 into field "1Sec"
            else
               put tSec1 into field "1Sec"
            end if
         else
            if tSec1 = 60 then
               put "00" into field "1Sec"
            end if
            put 0 into tSec1
            add 1 to tMin1
            if tMin <= 9 then
               put "0" & tMin1 into field "1Min"
            else
               put tMin1 into field "1Min"
            end if
         end if
      end repeat
   else
      set the label of me to "Start"
   end if
end mouseUpMy problem is that when i start the second timer the first timer freezes. As you can see in the code i have used 'with messages' on the 'wait' command, so i'm confused as to why the freezing is happening.
Grant.
