Time Counter

Yves COPPE yvescoppe at skynet.be
Tue Feb 22 12:22:38 EST 2005


Le 22-févr.-05, à 13:24, Malte Brill a écrit :
>
> on mouseUp
>    --we need to call the startMyTimer handler fom somewhere
>    --this could also be on openCard or openStack
>    set the istimer of me to 0
>    --reset the timer
>    if the flag of me is empty then set the flag of me to -1
>    --initialize a flag custom property
>    --Using this cProp we can check if the timer is already running...
>    set the flag of me to the flag of me*-1
>    --change the flag if you click
>    --possible values are -1 and 1
>   --the first time you click it will set the cProp to 1
>    if the flag of me=1 then startMyTimer
>   --if the cProp is 1 then call the timer the first time
> end mouseUp
>
> on startMyTimer
>    set the isTimer of me to the isTimer of me+1
>    --increase the value of the timer. It will only count
>    put the isTimer of me div 60 into myMinutes
>    --calculate the number of whole minutes
>    if myMinutes<10 then put "0"&myMinutes into myMinutes
>    --if it is smaller than 10 then add an additional zero before it
>    put the isTimer of me mod 60 into mySeconds
>   --what´s left ofer when dividing by 60 is the seconds
>    if mySeconds<10 then put "0"&mySeconds into mySeconds
>   --add additional zero if necessary
>    put myminutes&":"&myseconds
>   --put minutes:seconds into msg
>    if the flag of me=1 then send startMyTimer to me in 1 second
>   --if the flag cProp of the calling object is 1 then call the 
> startMyTimer handler again
>   --so if you click the button holding the script again the flag will 
> be set to -1
>   --and the handler wont be called anymore
> end startMyTimer
>
>

Hi Malte,

When you clic on the btn to stop the tilmer, the timer returns to "00 
01". It should be better if he'd return to "00 00"

Is it possible ?


thank you





Greetings.

Yves COPPE
yvescoppe at skynet.be


More information about the use-livecode mailing list