Convert to seconds, why??

miscdas at boxfrog.com miscdas at boxfrog.com
Tue May 27 14:55:00 EDT 2003


François Cuneo writes: 

> Hello, 
> 
>  
> 
> I have a field that show a timer.
> Each clic on the little Arrow, the user obtains 30 seconds more. 
> 
> So the field shows 
> 00:05:00
> I click and after I should obtain
> 00:05:30
> I click and after I should obtain
> 00:06:00 
> 
> I have written this script in the littlearrow 
> 
> 
> on scrollbarLineDec 
> 
>   set the twelveHourTime to false 
> 
>   put cd fld "règletemps" into tampon
>   convert tampon from long time to seconds 
> 
> 
>   put tampon-1053993600 into tampon
>   put tampon +29 into tampon
>   convert tampon from seconds to long time
>   put tampon into cd fld "règletemps"
>     
>   wait 6 ticks
>   
> end scrollbarLineDec 
> 
> If I don't put 
> "put tampon-1053993600 into tampon
>   put tampon +29 into tampon" 
> 
> But only 
> "Put tampon +30 into tampon" 
> 
> All is wrong. 
> 
> Whhhhhyyyyyyy? 
> 
> 
> Thank you! 
> 
> Friendly 
> 
> François 
> 
> François Cuneo
==========
Mr. Cuneo, 

This script works OK for me in a normal button: 

put field "TimerDisplay" into tTimeToDisplay
 convert tTimeToDisplay from long time to seconds
 add 30 to tTimeToDisplay
 convert tTimeToDisplay from seconds to long time
 put  tTimeToDisplay into field "TimerDisplay" 


miscdas



More information about the use-livecode mailing list