I have trouble to create countdown and countup timer
I found a code by googling and I success apply this code into my Application, BUT
The code can't count down more than 24:00.
And I try to modify the code to count up, I have no luck too.
What I want is:
1. CountDown from more than 24:00. ex: 90:00 or more.
2. Count Up from 00:00 to 45:00 and then stop. Then When I resume, The count up continue to 90:00 and then stop. ( I use this for soccer timer).
Any body could give me a guidance to solve my problem?
Comment and help would be appreciate.
thanx
Here is the code
Code: Select all
on mouseUp
If the label of ME is "PLAY" then
set the label of ME to "PAUSE"
set the backgroundcolor of ME to green
else
set the label ME to "PLAY"
set the backgroundcolor of ME to empty
end if
DoCountDown field TIMER_fld
end mouseUp
on DoCountDown pTime
if label of me is "PLAY"
else
convert pTime to seconds
subtract 1 from pTime
convert pTime to dateItems
split pTime by ","
put format("%02d:%02d",pTime[4],pTime[5],pTime[6]) into tNewTime
put tNewTime into fld "TIMER_fld"
//CASPAR
if tNewTime = "00:00" then do TimesUp
else
send "DoCountDown tNewTime" to me in 1 second
end if
end if
end DoCountDown
on TimesUp
//CASPAR
end TimesUp
on TimesStopped
end TimesStopped