It is almost never safe to assume your code is perfect

Kay C Lan lan.kc.macmail at gmail.com
Fri Oct 4 12:51:00 CEST 2013


Hi Geoff,

I'm not sure what the original context was, so I guess there was a need for
'the long seconds', but I just created two clock faces and ran one against
your original code, and the other with the 2 references to the long seconds
removed, i.e it just updates every second.

The outputs are identical.

So no less lines of code but about 50 chars less typing.


On Fri, Oct 4, 2013 at 6:36 AM, Geoff Canyon <gcanyon at gmail.com> wrote:

>
> on setTime
>    put word 1 of the long time into T
>    put T && the long seconds into fld "time"
>    split T using ":"
>    set the startangle of grc "second" to 90 - (6 * T[3])
>    if T[3] mod 10 = 0 then set the startangle of grc "minute" to 90 - (6 *
> T[2]) - (T[3] div 10)
>    if T[3] mod 10 = 0 and  T[2] mod 2 = 0 then set the startangle of grc
> "hour" to 90 - (30 * T[1]) - (T[2] div 2)
>    send "setTime" to me in (1 - (the long seconds mod 1)) seconds
> end setTime
>
> Never be satisfied.
>
> gc
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list