@ CHECKBOOK — HP-28S @ Transcribed from the notebook, scan-checkbook.pdf (notebook pages 17-18). @ No manual page survives for this one; the listings are all there is. @ @ SETUP creates a subdirectory DATA holding three variables: BAL (a running @ balance), CHK (a list of cheques) and DEP (a list of deposits). A cheque is @ four fields; a deposit is two. SETUP « CLLCD " SETUP NEW 'DATA'" 2 DISP " FILE...[Y/N] ?" 3 DISP DO UNTIL KEY END "Y" SAME IF 1 SAME THEN 'DATA' CRDIR DATA 0 'BAL' STO { } 'CHK' STO { } 'DEP' STO CHECK ABORT ELSE ABORT END » @ Write a cheque: four fields off the stack, appended to CHK, subtracted from BAL. WRIT « 4 →LIST → c « DATA 'CHK' RCL LIST→ → n « c n 1 + →LIST 'CHK' STO c LIST→ DROP 'BAL' RCL SWAP - 'BAL' STO 3 DROPN CHECK » » » @ Record a deposit: two fields, appended to DEP, added to BAL. DEPOS « 2 →LIST → d « DATA 'DEP' RCL LIST→ → n « d n 1 + →LIST 'DEP' STO d LIST→ DROP 'BAL' RCL SWAP + 'BAL' STO DROP CHECK » » » @ Page through the cheques. Any key but ENTER stops. VCHK « DATA 'CHK' RCL LIST→ 1 SWAP START LIST→ DROP CLLCD 4 DISP 3 DISP 2 DISP 1 DISP DO UNTIL KEY END "ENTER" SAME IF 1 ≠ THEN CLEAR CHECK CLMF ABORT END NEXT CHECK CLMF » @ Page through the deposits. VDEP « DATA 'DEP' RCL LIST→ 1 SWAP START LIST→ DROP CLLCD 3 DISP 1 DISP DO UNTIL KEY END "ENTER" SAME IF 1 ≠ THEN CLEAR CHECK CLMF ABORT END NEXT CHECK CLMF » BALAN « DATA 'BAL' RCL CHECK » @ Correct the balance by hand — reconciling against the bank. FXBAL « DATA 'BAL' STO CHECK » @ Full statement to the infrared printer: balance, then every cheque, then @ every deposit. PRINT « DATA 'BAL' RCL PR1 CR CR 'CHK' RCL LIST→ 1 SWAP START LIST→ DROP CLLCD 4 DISP 3 DISP 2 DISP 1 DISP PRLCD CR NEXT CR 'DEP' RCL LIST→ 1 SWAP START LIST→ DROP CLLCD 3 DISP 1 DISP PRLCD CR NEXT CHECK CR CR DROP CLMF »