From helens!shelby!rutgers!tut.cis.ohio-state.edu!ucbvax!GACVAX1.BITNET!HUBER Tue May 22 01:13:52 PDT 1990 Status: RO Article 1710 of comp.sys.handhelds: Path: helens!shelby!rutgers!tut.cis.ohio-state.edu!ucbvax!GACVAX1.BITNET!HUBER >From: HUBER@GACVAX1.BITNET Newsgroups: comp.sys.handhelds Subject: Calendar program for the HP48 Message-ID: <9005212211.AA12682@hercules.csl.sri.com> Date: 21 May 90 20:46:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 130 The CALN program below generates a calendar on the HP48 screen, and optionally makes a hard copy of the calendar. This is a modified version of the calendar program written by Eric B. Davis (originally from the HP bulletin board, user.programs, Item 48) It runs significantly faster than the original program. After downloading the CALN program the HP48, Press the CALN key and it will prompt you for the month number (1-12) and year. It will then display the calendar on the screen and wait for a keypress. It creates a variable CALPRT which it uses to determine whether to print the calendar on the printer. If a 0 is stored in CALPRT the program displays the graph If a 1 is stored in CALPRT the program displays the graph, stores the calendar in the variable CALSTR and prints it on the printer. Good luck with the program! Tom Huber HUBER@GACVAX1.BITNET Dept of Physics Gustavus Adolphus College ----------------------------------- CALN --------------------------------- %%HP: T(3)A(D)F(.); @ @ Written by Eric B. Davis @ @ Modified by Tom Huber 21-MAY-1990 @ \<< "Enter Month Number" "" INPUT OBJ\-> \-> month \<< "JanFebMarAprMayJunJulAugSepOctNovDec" month 1 - 3 * 1 + DUP 2 + SUB \-> mstr \<< "Enter Year" ":" mstr ":" + + INPUT OBJ\-> DTAG \-> year \<< year 1000000 / month + .01 + DUP 0 TSTR 1 3 SUB SWAP IF 'month==12' THEN year 1 + 1000000 / month 11 - .01 + + ELSE year 1000000 / month 1 + + .01 + END DDAYS SWAP 0 " 1 2 3 4 5 6 7 8 9 10" " 11 12 13 14 15 16 17 18 19 20" " 21 22 23 24 25 26 27 28 29 30 31" + + " " \<< IF CALPAR 1 == THEN DUP CALST ROT "\013\010" + + 'CALST' STO END 2 \->GROB GOR \>> \-> eject day n daystr bstr dspstr \<< @ main program IFERR 'CALPAR' RCL DROP THEN DROP 0 'CALPAR' STO @ Store a 1 in CALPAR to print the calendar END #131d #63d BLANK PICT STO IF CALPAR 1 == THEN " " mstr " " year "\013\010" + + + + 'CALST' STO END @ Set up the blank string at start of month bstr 1 CASE day "MON" SAME THEN 3 END day "TUE" SAME THEN 6 END day "WED" SAME THEN 9 END day "THU" SAME THEN 12 END day "FRI" SAME THEN 15 END day "SAT" SAME THEN 18 END 0 END SUB @ Create the calendar daystr 1 eject 3 * SUB bstr + + 'daystr' STO PICT RCL {#2d #0d} " Su Mo Tu We Th Fr Sa" dspstr EVAL 0 5 FOR n #2d #11d n 8 * + 2 \->LIST daystr n 21 * 1 + DUP 20 + SUB dspstr EVAL NEXT {#80d #56d} mstr " " + year \->STR + 2 \->GROB GOR PICT STO {#0d #0d} PVIEW 7 FREEZE IF CALPAR 1 == THEN CALST PR1 DROP END \>> @ end main program \>> \>> \>> \>>