From helens!relgyro!shelby!rutgers!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpda!hpcupt1!jodell Thu Jul 12 13:50:22 PDT 1990 Status: RO Article 2141 of comp.sys.handhelds: Path: helens!relgyro!shelby!rutgers!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpda!hpcupt1!jodell >From: jodell@hpcupt1.HP.COM (Jamie Odell) Newsgroups: comp.sys.handhelds Subject: A Clock Program Message-ID: <10490014@hpcupt1.HP.COM> Date: 11 Jul 90 21:04:56 GMT Organization: Hewlett Packard, Cupertino Lines: 91 I'm posting this for a friend who cannot post to notes.... ---------------------------------------------------------- The following programs display a running analog clock (with a second hand). Put all of these routines in the same directory and execute CLOK. The clock face came from Matt Squire's original analog clock program posted in comp.sys.handhelds on USENET News. Enjoy! -- | Pete Stoppani | stoppani@decwet.dec.com | | DECwest Engineering | decwrl!slough.enet!stoppani | | Bellevue, WA | HPDESK: stoppani("decwet.dec.com")/hpunix | | "The wise learn more from fools than fools learn from the wise." | ------------------------------------------------------------------------------- @ CLOK - main clock program %%HP: T(3)A(D)F(.); \<< RCLF -16 SF -17 CF -18 CF -19 SF ERASE 'PPAR' PURGE PICT { # 34d # 1d } FACE GOR { # 0d # 0d } PVIEW GET.TMS \-> pt pm ps \<< pt HR.HND pm MIN.HND ps SEC.HND 1 WAIT DO GET.TMS \-> t m s \<< IF 's\=/ps' THEN ps SEC.HND s SEC.HND s 'ps' STO END IF 'm\=/pm' THEN IF 'm MOD 12==0' THEN pt HR.HND t HR.HND t 'pt' STO END pm MIN.HND m MIN.HND m 'pm' STO END \>> UNTIL KEY END DROP STOF 'PPAR' PURGE \>> \>> @ GET.TMS - time, minutes and seconds %%HP: T(3)A(D)F(.); \<< TIME DUP FP 100 * DUP IP SWAP FP 100 * IP \>> @ HR.HND - draw the hour hand %%HP: T(3)A(D)F(.); \<< 1.55 SWAP HMS\-> 12 MOD 30 * NEG 90 + \->V2 (0,0) SWAP TLINE \>> @ MIN.HND - draw the minute hand %%HP: T(3)A(D)F(.); \<< 2.5 SWAP 60 / 360 * NEG 90 + \->V2 (0,0) TLINE \>> @ SEC.HND - draw the second hand %%HP: T(3)A(D)F(.); \<< 60 / 360 * NEG 90 + \-> d \<< 2.3 d \->V2 2.7 d \->V2 TLINE \>> \>> @ FACE - the clock face GROB %%HP: T(3)A(D)F(.); GROB 63 63 000000CFF100000000000C380E1000000000830800E00000000060080003000000081000 000C000000041000000410000002200000042000008120000002C0000040000000000100 002000000000020000100000000004000800000000000800080000000000080004000000 000000100200000000000020010000000000004003000000000000608C00000000000890 800000000000008040000000000000014000000000000001400000000000000120000000 000000022000000000000002200000000000000220000000000000021000000000000004 100000000000000410000000000000041000000E300000041000000220000004F0000002 2000008710000002200000041000000E3000000410000000000000041000000000000004 100000000000000420000000000000022000000000000002200000000000000220000000 000000024000000000000001400000000000000140000000000000018000000000000080 880000000000088007000000000000700100000000000040020000000000002004000000 000000100800000000000800080000000000080000100000000004000020000000000200 0040000000000100008120000002C0000002200000042000000410000004100000081000 000C000000006008000300000000830800E0000000000C380E100000000000CFF1000000