here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE

Geoff Canyon geoff at runrev.com
Tue May 31 00:55:48 EDT 2005


Darn, forgot one more thing. Instead of setting the itemDelimiter,  
using the split command allows a cleaner T[1] syntax instead of item  
1 of T. It is probably a bit faster as well.

New script:

on openCard
   setTime
end openCard

local sHourAngle -- the angle for the hour hand
local sMinuteAngle -- the angle for the minute hand

on setTime
   put word 1 of the long time into T
   put T && the long seconds into fld "time"
   split T using ":"
   get 90 - (30 * T[1]) - trunc(T[2] / 2)
   if it is not sHourAngle then
     put it into sHourAngle
     set the startangle of grc "hour" to sHourAngle
   end if
   get 90 - (6 * T[2]) - trunc(T[3] / 10)
   if it is not sMinuteAngle then
     put it into sMinuteAngle
     set the startangle of grc "minute" to sMinuteAngle
   end if
   set the startangle of grc "second" to 90 - (6 * T[3])
   send "setTime" to me in (1 - (the long seconds mod 1)) seconds
end setTime


More information about the use-livecode mailing list