var tod, tup, tap : string
var sc, mn, hr : int
var counter : int := 0
var asec, amin, ahr : real
var fonta : int := Font.New ("Arial:8")
setscreen ("offscreenonly,nobuttonbar,title: Clock Display")
time (tup)
tap := tup
loop
time (tod)
if tap not= tod then
time (tup)
tap := tup
hr := strint (tup (1 .. index (tup, ":")  1))
tup := tup (index (tup, ":") + 1 .. *)
mn := strint (tup (1 .. index (tup, ":")  1))
tup := tup (index (tup, ":") + 1 .. *)
sc := strint (tup)
asec := (sc / 60) * (Math.PI * 2)
amin := (mn / 60) * (Math.PI * 2)
ahr := (hr / 12) * (Math.PI * 2)
cls
drawoval (maxx div 2, maxy div 2, 42, 42, blue)
drawoval (maxx div 2, maxy div 2, 58, 58, blue)
drawoval (maxx div 2, maxy div 2, 62, 62, green)
drawoval (maxx div 2, maxy div 2, 78, 78, green)
drawoval (maxx div 2, maxy div 2, 82, 82, red)
drawoval (maxx div 2, maxy div 2, 98, 98, red)
Draw.ThickLine (round (sin (ahr) * 55) + maxx div 2, round (cos (ahr) * 55) + maxy div 2, round (sin (ahr) * 45) + maxx div 2, round (cos (ahr) * 45) + maxy div 2, 1, blue)
Draw.ThickLine (round (sin (amin) * 65) + maxx div 2, round (cos (amin) * 65) + maxy div 2, round (sin (amin) * 75) + maxx div 2, round (cos (amin) * 75) + maxy div 2, 1, green)
Draw.ThickLine (round (sin (asec) * 95) + maxx div 2, round (cos (asec) * 95) + maxy div 2, round (sin (asec) * 85) + maxx div 2, round (cos (asec) * 85) + maxy div 2, 1, red)
drawline (maxx div 2  1, maxy div 2 + 100, maxx div 2  1, maxy div 2 + 110, black)
drawline (maxx div 2 + 1, maxy div 2 + 100, maxx div 2 + 1, maxy div 2 + 110, black)
drawline (maxx div 2 + 100, maxy div 2, maxx div 2 + 110, maxy div 2, black)
drawline (maxx div 2  100, maxy div 2, maxx div 2  110, maxy div 2, black)
drawline (maxx div 2, maxy div 2  100, maxx div 2, maxy div 2  110, black)
drawoval (maxx div 2, maxy div 2, 112, 112, black)
Font.Draw (tap, maxx div 2  (Font.Width (tap, fonta) div 2), maxy div 2  4, fonta, black)
% counter += 1
% locate (1, 1)
% put counter
View.Update
end if
end loop
