here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Wed Jun 8 12:24:38 EDT 2005
Hi Scott,
I'm afraid preOpenCard instead of openCard will not solve the problem.
In the worst case, you will have to wait 9 seconds to see the minutes
hand correctly positionned and almost 2 minutes for the hours one.
Best regards from Paris,
Eric Chatonet.
Le 8 juin 05 à 18:14, Scott Rossi a écrit :
> Recently, Eric Chatonet wrote:
>
>
>> on openCard
>> setTime
>> end openCard
>>
>> on setTime
>> send "setTime" to me in 1 - (the long seconds mod 1) seconds
>> put word 1 of the long time into T --8:13:15
>> put T & char 2 to 7 of (the long seconds mod 1) into fld "Time"
>> split T using ":"
>> set the angle of grc "Second" to 450 - (6 * T[3])
>> if T[3] mod 10 <> 0 then exit setTime
>> set the angle of grc "Minute" to 90 - (6 * T[2]) - (T[3] div 10)
>> if T[3] <> 0 or T[2] mod 2 <> 0 then exit setTime
>> set the angle of grc "Hour" to 90 - (30 * T[1]) - (T[2] div 2)
>> end setTime
>>
>
>
>> Very impressed to see how much a code can be improved again and
>> again.
>> Just a little thing: with this new very clever code, the clock will
>> not be at time just when opening ;-)
>> So 4 lines more and 2 repetitions that are not satisfying: I bet you
>> will find a better solution in 3 minutes!
>>
>
> If I understand your comment, I believe all you need to do is change
> "on openCard" to "on preOpenCard" -- no extra lines needed.
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Multimedia & Design
> -----
> E: scott at tactilemedia.com
> W: http://www.tactilemedia.com
----------------------------------------------------------------
So Smart Software
For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
Plugins, tutorials and more on our website
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email eric.chatonet at sosmartsoftware.com/
Phone 33 (0)1 43 31 77 62
Mobile 33 (0)6 20 74 50 86
----------------------------------------------------------------
More information about the use-livecode
mailing list