Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

\2A\10\40 — LD HL,(4010H) ; \11\43\00 — LD DE,0043H ; \ED\52 — SBC HL,DE ; \E5 — PUSH HL ; \11\21\00 — LD DE,0021H ; \ED\52 — SBC HL,DE ; \D1 — POP DE ; \01\EF\01 — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; \06\20 — LD B,20H ; \2B — DEC HL ; \36\00 — LD (HL),00 ; \10\FB — DJNZ loop ; \C9 — RET. The trailing \3D\3D\3D bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
A
— LD HL,(4010H) ;

Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

\2A\10\40 — LD HL,(4010H) ; \11\43\00 — LD DE,0043H ; \ED\52 — SBC HL,DE ; \E5 — PUSH HL ; \11\21\00 — LD DE,0021H ; \ED\52 — SBC HL,DE ; \D1 — POP DE ; \01\EF\01 — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; \06\20 — LD B,20H ; \2B — DEC HL ; \36\00 — LD (HL),00 ; \10\FB — DJNZ loop ; \C9 — RET. The trailing \3D\3D\3D bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
— LD DE,0043H ; \ED — SBC HL,DE ; \E5 — PUSH HL ;

Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

\2A\10\40 — LD HL,(4010H) ; \11\43\00 — LD DE,0043H ; \ED\52 — SBC HL,DE ; \E5 — PUSH HL ; \11\21\00 — LD DE,0021H ; \ED\52 — SBC HL,DE ; \D1 — POP DE ; \01\EF\01 — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; \06\20 — LD B,20H ; \2B — DEC HL ; \36\00 — LD (HL),00 ; \10\FB — DJNZ loop ; \C9 — RET. The trailing \3D\3D\3D bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
— LD DE,0021H ; \ED — SBC HL,DE ; \D1 — POP DE ; itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56664 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.7 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.5"\EF itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular computer_media-template-default single single-computer_media postid-56664 wp-custom-logo wp-embed-responsive wp-theme-astra wp-child-theme-astra-child ast-desktop ast-separate-container ast-left-sidebar astra-4.12.7 group-blog ast-blog-single-style-1 ast-custom-post-type ast-single-post ast-inherit-site-logo-transparent ast-hfb-header ast-full-width-primary-header ast-box-layout ast-normal-title-enabled astra-addon-4.12.5" — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; — LD B,20H ;

Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

\2A\10\40 — LD HL,(4010H) ; \11\43\00 — LD DE,0043H ; \ED\52 — SBC HL,DE ; \E5 — PUSH HL ; \11\21\00 — LD DE,0021H ; \ED\52 — SBC HL,DE ; \D1 — POP DE ; \01\EF\01 — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; \06\20 — LD B,20H ; \2B — DEC HL ; \36\00 — LD (HL),00 ; \10\FB — DJNZ loop ; \C9 — RET. The trailing \3D\3D\3D bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
B
— DEC HL ;

Bookkeeper

Products: The Bookkeeper
Date: 1984
Type: Cassette
Platform(s): TS 1000
Tags: Business

This program is a double-entry bookkeeping ledger system that manages journal entries, account balances, and financial reports including balance sheets and income statements. It stores transactions in a string array A$ (27 characters per entry) encoding date, name, amount, debit/credit account codes, and a reconciliation flag, with parallel numeric array A() holding the monetary value. A machine-code routine is embedded in line 20 as a REM statement and called repeatedly via RAND USR to perform fast screen scrolling, with its entry point stored in variable UP (and DN for downward scroll). The program uses POKEs to system variables at addresses 16518, 16528, and 16529 to redirect LPRINT output to the screen during journal display, then restores them afterward. Financial categories are defined in a C$ array mapping group names to account number ranges, enabling automatic aggregation for balance sheet and income statement generation. Requires 64K RAM.


Program Analysis

Program Structure

The program is organized into a main menu dispatcher and a large collection of subroutines, with two distinct top-level menu loops. Lines 40–110 handle the journal-entry menu (dispatched from line 6400), and lines 130–200 handle the accounts menu (dispatched from line 6200). Initialization occurs at lines 7020–7110, which dimension all arrays and zero key variables before jumping to line 30 (a non-existent line, used as a deliberate entry point into the menu display at line 6320/6330). Line 6840 (referenced by “Q” for Quit) jumps to a CLS/LIST block at 6850–6890.

Variable Aliasing (Line Number Shortcuts)

Throughout the program, subroutine calls use variable names in place of literal line numbers — a classic memory-saving technique where a variable holds the target line number. The following aliases are used:

VariableTarget LinePurpose
A2470 areaDisplay journal entry at QJ
A3470 areaPrint single journal record
A4760 areaEnter/edit journal record
A82470Format currency value BN → X$
A11~4880Wait for keypress (INKEY$ loop)
B4/B6/B7/B9various 3xxxBalance/Income sub-sections
C5/C6/C7variousOutput helpers (print line, scroll)
D6~6172Display header block
UP / DNUSR addrMachine code scroll up/down

Machine Code Routine

Line 20 contains a REM statement that embeds a machine-code routine as raw bytes. The bytes decode as Z80 instructions for a fast screen-scroll operation. RAND USR UP and RAND USR DN are called throughout the program to scroll the display up or down without using slow BASIC SCROLL. The REM bytes in hex are:

\2A\10\40 — LD HL,(4010H) ; \11\43\00 — LD DE,0043H ; \ED\52 — SBC HL,DE ; \E5 — PUSH HL ; \11\21\00 — LD DE,0021H ; \ED\52 — SBC HL,DE ; \D1 — POP DE ; \01\EF\01 — LD BC,01EFH ; \ED\B8 — LDDR ; \EB — EX DE,HL ; \06\20 — LD B,20H ; \2B — DEC HL ; \36\00 — LD (HL),00 ; \10\FB — DJNZ loop ; \C9 — RET. The trailing \3D\3D\3D bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top
— LD (HL),00 ; \FB — DJNZ loop ; \C9 — RET. The trailing DDD bytes are unused. The routine performs a block memory move to scroll screen content, then clears the vacated row.

Transaction Record Layout

Each transaction is stored in a 27-character string in A$(N). The fields are:

ColumnsField
1–3Entry number / reference
4–10Date (DD-MMM format, 7 chars)
11–22Name / description (12 chars)
23–24Debit account number (2 digits)
25–26Credit account number (2 digits)
27Reconciliation flag (“*” = reconciled)

The parallel numeric array A(N) stores the transaction amount as a floating-point value. Currency formatting is handled by subroutine A8 (line 2470), which converts BN to a 9-character string X$ with implied decimal point.

Account and Category System

Up to 99 accounts are supported, with names in N$(1..99) (string array), balances in N(1..99) (numeric), and formatted balance strings in B$(1..99,9). The C$ array defines 18 category groups, each holding a 12-character name and a from/to account range (columns 13–14 and 15–16). This drives the balance sheet and income statement aggregation in the 3000–3600 block, which iterates over account ranges and accumulates totals by group.

LPRINT Redirection

Lines 5512–5514 POKE system variables to redirect LPRINT output to the screen channel rather than the printer, allowing the journal print routine (lines 2540–2600) to be reused for both screen display and actual printing. Lines 5554–5556 restore the original values (POKE 16518,199; POKE 16528,239; POKE 16529,1) after display is complete.

Input Handling Idioms

  • Empty INPUT K$ (pressing ENTER with no text) is consistently used as “no change / skip field / cancel”, checking IF K$="" THEN RETURN.
  • A space input (K$=" ") is used as “accept current value and advance” throughout the data-entry loop (lines 920–1980).
  • IF K$="N" THEN is used as a “use previous value” shortcut in several fields (e.g., lines 1050, 1165).
  • The INKEY$-based menu loops at lines 6210–6310 and 6410–6540 poll without waiting, looping back to redisplay the menu screen if no recognised key is pressed.
  • Line 230 uses IF INKEY$="" THEN GOTO 230 as a simple keypress-wait after a slow-mode display.

Notable Bugs and Anomalies

  • Line 920 is referenced by GOSUB 920 at line 870, but line 920 does not exist — the actual code begins at line 930. On a ZX81/TS1000, GOTO/GOSUB to a non-existent line runs from the next line found, so execution falls through to line 930 correctly. This is a well-known technique.
  • Line 4540 is referenced in several places (e.g., line 4300, 4470) but does not exist; the next line is 4550, which handles the QJ=I end-of-file check — intentional fall-through.
  • Line 6410 uses GOTO 0120 (with leading zero), which evaluates as line 120 — a non-existent line, causing execution to fall through to line 130, the journal entry menu. This appears intentional.
  • Line 4853 and 4862 contain REM-commented-out validation logic (IF INKEY$<>"Y" OR INKEY$<>"N"), which would always be true due to the logical structure — the programmer correctly left these as comments.
  • The GOSUB A11 at line 4850 calls a subroutine via variable, but A11 appears to target the IF INKEY$="" THEN GOTO 4880 loop, which doubles as the wait-for-key routine and the menu dispatcher — the same loop is used for both purposes.
  • Line 6320 is referenced by GOSUB 6320 at line 70, but the actual display subroutine code starts at line 6330 — again a deliberate non-existent-line entry.

Pagination and Output Control

The variable SC tracks the current screen line count. Subroutine C7 (referenced throughout) checks SC against 22 and, when the screen is full, optionally pauses for a keypress (O1 flag) and/or sends a COPY to the printer (O2 flag) before clearing the screen. This provides a flexible paginated output system used by all report-generating routines.

Content

Appears On

Related Products

Up to 900 journal entries; 99 user-definable account names. Check register maintenance. Reports for journal with comments; ledger by account,...

Related Articles

Related Content

Image Gallery

Source Code

  10 REM E£RND)SIN  ; FAST )5 ;SGN '  LOAD '  GOSUB %K FOR .'4Q 7( CLS TAN 89XXX
  20 REM 2A104011430ED52E511210ED52D11EF1EDB8EB6202B36010FBC93D3D3D
  40 FAST 
  50 CLS 
  70 GOSUB 6320
  80 SLOW 
  82 PRINT AT 21,0;"COMMAND"
  84 PRINT AT 21,7;"?      ";AT 21,7;"%?"
  90 IF INKEY$="" THEN GOTO 80
 100 FAST 
 110 GOTO 6400
 130 FAST 
 140 CLS 
 160 GOSUB 6170
 170 SLOW 
 175 PRINT AT 21,0;"COMMAND"
 176 PRINT AT 21,7;"?      ";AT 21,7;"%?"
 180 IF INKEY$="" THEN GOTO 175
 190 FAST 
 200 GOTO 6200
 230 IF INKEY$="" THEN GOTO 230
 240 FAST 
 250 RETURN 
 325 LET SC=0
 330 FOR N=1 TO 3
 340 LET P=QJ-3+N
 350 IF P<1 THEN GOTO 370
 360 GOSUB A3
 370 NEXT N
 380 RETURN 
 470 LET BN=A(P)
 480 GOSUB A8
 490 PRINT AT 21,0;A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 492 GOSUB C7
 500 RAND USR UP
 510 PRINT AT 21,12;"%D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);TAB 31;A$(P,27)
 512 GOSUB C7
 520 RAND USR UP
 530 PRINT AT 21,6;P;TAB 12;"%C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 532 GOSUB C7
 540 RAND USR UP
 545 GOSUB C7
 550 RAND USR UP
 570 RETURN 
 590 PRINT AT 0,0;G$;G$;G$;
 600 LET BN=N(1)
 610 GOSUB A8
 620 PRINT AT 0,0;N$(1, TO 11);" ";X$
 630 LET BN=N(2)
 640 GOSUB A8
 650 PRINT N$(2, TO 11);" ";X$
 660 LET BN=N(3)
 670 GOSUB A8
 680 PRINT N$(3, TO 11);" ";X$
 690 LET AB=N(1)+N(2)+N(3)
 700 LET BN=AB
 710 GOSUB A8
 720 PRINT "TOTAL       ";X$
 730 PRINT H$;"NO...DATE...NAME..........AMOUNT"
 740 RETURN 
 760 CLS 
 770 LET QJ=I
 780 GOSUB A2
 790 GOSUB A4
 800 IF I=A THEN RETURN 
 810 DIM Z$(26)
 820 LET QJ=I
 830 LET IT=I+1
 840 LET Z=0
 850 LET EF=1
 860 LET OA=0
 870 GOSUB 920
 880 FAST 
 890 IF EF=1 THEN RETURN 
 900 LET I=I+1
 910 GOTO 790
 930 PRINT AT 0,22;"%E%N%T%E%R   "
 940 RAND USR UP
 950 RAND USR UP
 970 PRINT AT 21,0;"%?"
 980 SLOW 
 990 INPUT K$
 1000 FAST 
 1010 PRINT AT 21,0;" "
 1030 IF K$=" " THEN GOTO 1090
 1040 IF K$="" THEN RETURN 
 1050 IF K$="N" THEN LET CT=CN+1
 1060 IF CODE K$<38 THEN LET CT=VAL K$
 1070 LET K$=STR$ CT
 1080 LET Z$(4-LEN K$ TO )=K$
 1090 PRINT AT 21,0;Z$( TO 3)
 1110 PRINT AT 21,4;"%?"
 1120 SLOW 
 1130 INPUT K$
 1140 FAST 
 1150 IF K$=" " THEN GOTO 1250
 1160 IF K$="" THEN RETURN 
 1165 IF K$="N" THEN LET K$=A$(QJ,4 TO 10)
 1166 IF K$="N" THEN GOTO 1240
 1170 IF LEN K$<7 THEN LET K$=" "+K$
 1180 IF VAL K$( TO 2)>31 THEN GOTO 1120
 1190 LET MN=0
 1200 FOR N=3 TO 36 STEP 3
 1210 IF M$(N-2 TO N)=K$(3 TO 5) THEN LET MN=N/3
 1220 NEXT N
 1230 IF NOT MN THEN GOTO 1120
 1240 LET Z$(4 TO 10)=K$
 1250 PRINT AT 21,4;Z$(4 TO 10);" %?"
 1270 SLOW 
 1280 INPUT K$
 1290 FAST 
 1300 IF K$=" " THEN GOTO 1330
 1310 IF K$="" THEN RETURN 
 1320 LET Z$(11 TO 22)=K$
 1330 PRINT AT 21,12;Z$(11 TO 22);" %?"
 1350 SLOW 
 1360 INPUT K$
 1370 FAST 
 1380 IF K$=" " THEN GOTO 1410
 1390 IF K$="" THEN RETURN 
 1400 LET Z=VAL K$
 1410 LET BN=Z
 1420 GOSUB A8
 1430 PRINT AT 21,24;X$(2 TO )
 1450 RAND USR UP
 1460 PRINT AT 21,12;"%D%R %?"
 1470 SLOW 
 1480 INPUT K$
 1490 IF K$=" " THEN GOTO 1550
 1500 IF K$="" THEN RETURN 
 1510 LET DR=VAL K$
 1520 IF DR>99 THEN GOTO 1470
 1530 LET Z$(23 TO 24)=K$
 1550 PRINT AT 21,15;Z$(23 TO 24);" ";N$(DR, TO 6)
 1570 RAND USR UP
 1580 PRINT AT 21,12;"%C%R %?"
 1590 INPUT K$
 1600 IF K$=" " THEN GOTO 1650
 1610 IF K$="" THEN RETURN 
 1620 LET CR=VAL K$
 1630 IF CR>99 THEN GOTO 2340
 1640 LET Z$(25 TO 26)=K$
 1650 PRINT AT 21,15;Z$(25 TO 26);" ";N$(CR, TO 6)
 1670 RAND USR UP
 1680 PRINT AT 21,5;"%?"
 1690 INPUT K$
 1700 LET D$=K$
 1710 PRINT AT 21,5;D$
 1740 PRINT AT 21,0;"%O%K%?"
 1750 INPUT K$
 1760 PRINT AT 21,0;"    "
 1770 IF K$="N" THEN RETURN 
 1772 IF K$="Y" THEN GOTO 1780
 1774 GOTO 1740
 1780 LET EF=0
 1800 FAST 
 1810 LET A$(IT)=Z$
 1820 LET A(IT)=Z
 1830 LET N(DR)=N(DR)+Z
 1840 LET BN=N(DR)
 1850 GOSUB A8
 1860 LET B$(DR)=X$
 1870 LET N(CR)=N(CR)-Z
 1880 LET BN=N(CR)
 1890 GOSUB A8
 1900 LET B$(CR)=X$
 1910 LET CN=CT
 1920 LET P=IT
 1930 PRINT AT 20,6;P
 1940 GOSUB 2540
 1950 LPRINT "     ";D$
 1960 LPRINT 
 1970 LET D$=""
 1980 RETURN 
 2000 PRINT AT 21,0;"ARE YOU SURE? "
 2002 INPUT K$
 2004 IF K$<>"Y" THEN RETURN 
 2006 FAST 
 2010 PRINT AT 21,0;"ENTER NO. OR ""O"""
 2012 INPUT K$
 2014 IF K$="" THEN RETURN 
 2015 IF K$="O" THEN LET QJ=R+1
 2016 IF K$="O" THEN GOTO 2025
 2020 LET QJ=VAL K$
 2025 LET I=I-QJ+1
 2030 FOR N=1 TO I
 2035 LET A$(N)=A$(N+QJ-1)
 2040 LET A(N)=A(N+QJ-1)
 2045 NEXT N
 2055 LET QJ=I
 2060 LET R=0
 2065 RETURN 
 2200 PRINT AT 21,0;"ARE YOU SURE? "
 2202 INPUT K$
 2204 IF K$<>"Y" THEN RETURN 
 2206 FAST 
 2210 LET CX=0
 2212 LET S=0
 2214 GOSUB 3280
 2220 LET BN=BT+ST
 2222 LET N(VAL C$(8,13 TO 14))=BN+N(VAL C$(8,13 TO 14))
 2223 LET BN=N(VAL C$(8,13 TO 14))
 2224 GOSUB A8
 2226 LET B$(VAL C$(8,13 TO 14))=X$
 2230 LET CX=1
 2232 PRINT AT 21,0;"THE BOOKS ARE CLOSED"
 2234 SLOW 
 2236 PAUSE 20
 2238 RETURN 
 2470 LET X$="       0 "
 2480 LET B=INT (BN*100)
 2490 IF BN*100-B>=.5 THEN LET B=B+1
 2500 LET J$=STR$ B
 2510 LET X$(10-LEN J$ TO )=J$
 2520 LET X$( TO 7)=X$(2 TO 7)+"."
 2530 RETURN 
 2540 REM *** LPRINT JOURNAL1 ***
 2550 LET BN=A(P)
 2560 GOSUB A8
 2570 LPRINT "           ";P,,A$(P, TO 3);" ";A$(P,4 TO 10);" ";A$(P,11 TO 22);X$(2 TO )
 2580 LPRINT "            %D%R ";A$(P,23 TO 24);" ";N$(VAL A$(P,23 TO 24), TO 6);"       ";A$(P,27)
 2590 LPRINT "            %C%R ";A$(P,25 TO 26);" ";N$(VAL A$(P,25 TO 26), TO 6)
 2600 RETURN 
 2610 REM *** ACCT BAL PRINT ****
 2630 FOR N=1 TO 15
 2640 LET P=QB-15+N
 2650 IF P<1 THEN GOTO 2690
 2660 RAND USR UP
 2670 PRINT AT 20,0;
 2680 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2690 NEXT N
 2700 RETURN 
 2720 PRINT AT 21,0;"WHICH ACCOUNT?"
 2730 SLOW 
 2732 INPUT K$
 2734 FAST 
 2735 PRINT AT 21,0;"              "
 2736 IF K$="" THEN RETURN 
 2740 LET QB=VAL K$
 2745 GOSUB 2620
 2746 PRINT AT 20,3;"%?"
 2747 SLOW 
 2749 INPUT K$
 2751 IF K$="" THEN RETURN 
 2753 LET N$(QB)=K$
 2760 PRINT AT 20,3;N$(QB);TAB 23;B$(QB)
 2770 GOTO 2720
 2790 IF QB=99 THEN RETURN 
 2800 LET QB=QB+1
 2810 RAND USR UP
 2820 LET P=QB
 2830 PRINT AT 20,0;
 2840 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2850 RETURN 
 2870 IF QB=1 THEN RETURN 
 2880 LET QB=QB-1
 2890 RAND USR DN
 2900 IF QB<=16 THEN RETURN 
 2910 LET P=QB-15
 2920 PRINT AT 6,0;
 2930 PRINT P;TAB 3;N$(P);TAB 23;B$(P)
 2940 RETURN 
 2952 PRINT AT 21,0;"DATE?      "
 2953 SLOW 
 2954 INPUT D$
 2955 FAST 
 2960 LET CX=1
 2962 LET S=0
 2964 CLS 
 2966 GOSUB D6
 2968 LET SC=5
 2970 GOSUB C7
 2972 GOSUB C6
 2974 PRINT TAB 8;F$(N)
 2976 GOSUB C7
 2978 PRINT TAB 8;F$(7)
 2980 GOSUB C7
 2982 GOSUB C6
 2984 PRINT TAB (32-LEN D$)/2;D$
 2986 GOSUB C7
 2988 GOSUB C6
 2990 PRINT TAB 8;F$(M)
 2992 GOSUB C7
 2994 PRINT TAB 8;F$(7)
 2996 GOSUB C7
 2998 RETURN 
 3002 LET N=1
 3004 LET M=2
 3006 GOSUB B4
 3008 LET X=1
 3010 LET Y=4
 3012 GOSUB B9
 3014 LET ST=BT
 3016 LET BN=ST
 3018 GOSUB A8
 3020 LET N=14
 3022 LET M=4
 3024 GOSUB B6
 3026 LET X=5
 3028 LET Y=7
 3030 GOSUB B9
 3032 LET LT=BT
 3034 LET BN=LT
 3036 GOSUB A8
 3038 LET N=16
 3040 LET M=5
 3042 GOSUB B6
 3044 LET X=8
 3046 LET Y=8
 3048 GOSUB B9
 3050 LET BN=LT+BT
 3052 GOSUB A8
 3054 LET N=6
 3056 GOSUB B7
 3058 LET N=8
 3060 GOTO 3220
 3064 GOSUB C5
 3066 PRINT F$(N);TAB 23;X$
 3068 GOSUB C7
 3070 GOSUB C6
 3072 PRINT H$
 3074 GOSUB C7
 3076 GOSUB C6
 3078 GOSUB C6
 3080 PRINT TAB 8;F$(M)
 3082 GOSUB C7
 3084 PRINT TAB 8;F$(7)
 3086 GOSUB C7
 3088 GOSUB C6
 3090 RETURN 
 3190 REM *** BAL/INC SUB 3 *****
 3200 GOSUB C5
 3202 PRINT F$(N)
 3204 GOSUB C7
 3206 PRINT TAB 23;X$
 3208 GOSUB C7
 3210 GOSUB C6
 3212 PRINT H$
 3214 GOSUB C7
 3216 GOSUB C6
 3218 RETURN 
 3220 LET BN=ST+BN
 3222 GOSUB A8
 3224 GOSUB C5
 3226 PRINT F$(N);TAB 23;X$
 3228 GOSUB C7
 3230 GOSUB C6
 3232 PRINT H$
 3234 GOSUB C7
 3236 PRINT H$
 3238 GOSUB C7
 3240 LET SC=22
 3242 GOSUB C7
 3244 RETURN 
 3260 LET N=9
 3262 LET M=13
 3264 GOSUB B4
 3280 LET X=9
 3282 LET Y=11
 3284 GOSUB B9
 3310 LET ST=BT
 3312 IF NOT CX THEN GOTO 3350
 3314 LET BN=ST
 3316 GOSUB A8
 3318 LET N=15
 3320 LET M=11
 3322 GOSUB B6
 3350 LET X=12
 3352 LET Y=18
 3354 GOSUB B9
 3360 IF NOT CX THEN RETURN 
 3380 LET BN=BT
 3382 GOSUB A8
 3400 LET N=3
 3402 GOSUB B7
 3430 LET N=12
 3432 GOTO 3220
 3460 LET BT=0
 3462 FOR N=X TO Y
 3490 LET AT=0
 3492 IF S THEN GOTO 3592
 3500 IF NOT CX THEN GOTO 3505
 3501 PRINT C$(N, TO 12)
 3502 GOSUB C7
 3503 GOSUB C6
 3505 IF C$(N,13 TO 14)="  " THEN GOTO 3590
 3506 IF C$(N,15 TO 16)="  " THEN GOTO 3590
 3510 FOR M=VAL C$(N,13 TO 14) TO VAL C$(N,15 TO )
 3520 IF CX THEN GOSUB 3620
 3530 LET AT=AT+N(M)
 3532 IF CX THEN GOTO 3540
 3534 LET N(M)=0
 3536 LET B$(M)="         "
 3540 IF M=99 THEN LET S=1
 3550 NEXT M
 3560 IF NOT CX THEN GOTO 3590
 3562 LET BN=AT
 3564 GOSUB A8
 3566 GOSUB C5
 3570 PRINT TAB 3;"TOTAL";TAB 23;X$
 3572 GOSUB C7
 3574 GOSUB C6
 3590 LET BT=BT+AT
 3592 NEXT N
 3594 RETURN 
 3630 IF N$(M,1)=" " THEN RETURN 
 3640 PRINT M;TAB 3;N$(M);TAB 23;B$(M)
 3642 GOSUB C7
 3650 RETURN 
 3670 PRINT AT 21,0;"%S%E%A%R%C%H% %B%Y% %N%U%M%,% %D%A%T%E%,% %O%R% %N%A%M%E%?"
 3680 SLOW 
 3690 INPUT K$
 3700 FAST 
 3710 PRINT AT 18,0;G$;G$;G$;G$
 3715 PRINT AT 19,0;"SEARCH: ";K$
 3720 IF K$="" THEN RETURN 
 3730 IF K$="NUM" THEN GOTO 3770
 3740 IF K$="DATE" THEN GOTO 3820
 3750 IF K$="NAME" THEN GOTO 3870
 3760 GOTO 3670
 3780 LET X=1
 3790 LET Y=3
 3800 DIM S$(3)
 3810 GOTO 3910
 3830 LET X=4
 3840 LET Y=10
 3850 DIM S$(7)
 3860 GOTO 3910
 3880 LET X=11
 3890 LET Y=22
 3900 DIM S$(12)
 3910 PRINT AT 21,0;"%E%N%T%E%R% %T%H%E% %S%T%R%I%N%G"
 3920 SLOW 
 3930 INPUT K$
 3935 IF K$="" THEN RETURN 
 3940 FAST 
 3945 CLS 
 3950 LET QJ=0
 3960 LET S$=K$
 3970 LET QJ=QJ+1
 3980 IF QJ=I THEN GOTO 4090
 3990 IF A$(QJ,X TO Y)=S$ THEN GOTO 4010
 4000 GOTO 3970
 4010 GOSUB A2
 4020 IF QJ=I THEN RETURN 
 4030 PRINT AT 21,0;"%A%D%V%A%N%C%E%?        "
 4040 SLOW 
 4050 INPUT K$
 4060 FAST 
 4070 IF K$="Y" THEN GOTO 3970
 4080 RETURN 
 4090 RAND USR UP
 4093 PRINT AT 20,0;S$;" NOT FOUND"
 4097 RETURN 
 4100 IF QJ=I THEN RETURN 
 4110 LET QJ=QJ+1
 4120 LET P=QJ
 4130 GOSUB A3
 4140 RETURN 
 4160 IF QJ=1 THEN RETURN 
 4170 LET QJ=QJ-1
 4180 GOSUB A2
 4190 RETURN 
 4210 CLS 
 4230 LET QJ=R
 4240 LET RF=0
 4250 LET BO=0
 4260 IF NOT R THEN LET QJ=1
 4280 IF A$(QJ,27)="*" THEN GOTO 4550
 4290 IF VAL A$(QJ,23 TO 24)>=4 THEN GOTO 4300
 4292 LET DR=1
 4294 LET CR=NOT DR
 4296 GOTO 4320
 4300 IF VAL A$(QJ,25 TO 26)>=4 THEN GOTO 4540
 4302 LET CR=1
 4304 LET DR=NOT CR
 4320 LET SC=0
 4330 LET P=QJ
 4340 GOSUB A3
 4350 PRINT AT 21,0;"%R%E%T%U%R%N%E%D%?"
 4360 SLOW 
 4370 INPUT K$
 4380 FAST 
 4390 PRINT AT 21,0;G$
 4400 IF K$="" THEN RETURN 
 4410 IF K$="Y" THEN GOTO 4480
 4420 IF K$<>"N" THEN GOTO 4350
 4430 LET BO=BO-A(QJ)*DR+A(QJ)*CR
 4460 LET RF=1
 4470 GOTO 4540
 4490 IF RF THEN GOTO 4510
 4500 LET R=QJ
 4510 PRINT AT 19,31;"*"
 4520 LET A$(QJ,27)="*"
 4530 GOTO 4540
 4550 IF QJ=I THEN GOTO 4580
 4560 LET QJ=QJ+1
 4570 GOTO 4270
 4590 LET BN=AB
 4600 GOSUB A8
 4610 PRINT AT 0,0;"ACCOUNT";TAB 16;X$
 4620 LET BN=BO
 4630 GOSUB A8
 4640 PRINT "OUTSTANDING";TAB 16;X$;" "
 4650 PRINT "BANK";TAB 16;"%E%N%T%E%R"
 4660 PRINT "ERROR"
 4680 SLOW 
 4690 INPUT K$
 4700 FAST 
 4710 LET BB=VAL K$
 4720 LET BN=BB
 4730 GOSUB A8
 4740 PRINT AT 2,16;X$
 4750 LET BN=BB-AB-BO
 4760 GOSUB A8
 4770 PRINT AT 3,16;X$
 4780 SLOW 
 4790 RETURN 
 4835 LET SC=0
 4840 CLS 
 4842 GOSUB D6
 4845 PRINT R$
 4847 LET O1=0
 4848 SLOW 
 4849 PRINT AT 8,0;"%?"
 4850 GOSUB A11
 4851 PRINT AT 8,0;INKEY$
 4852 IF CODE INKEY$=118 THEN RETURN 
 4853 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4849
 4854 IF INKEY$="Y" THEN LET O1=1
 4855 LET O2=0
 4856 SLOW 
 4857 PRINT AT 9,0;"%?"
 4859 GOSUB A11
 4860 IF CODE INKEY$=118 THEN RETURN 
 4861 PRINT AT 9,0;INKEY$
 4862 REM IF INKEY$<>"Y" OR INKEY$<>"N" THEN GOTO 4857
 4864 IF INKEY$="Y" THEN LET O2=1
 4865 PAUSE 30
 4870 PRINT AT 21,0;"CHOICE?"
 4875 SLOW 
 4880 IF INKEY$="" THEN GOTO 4880
 4882 IF INKEY$="C" THEN GOSUB 5560
 4884 IF INKEY$="M" THEN RETURN 
 4886 IF INKEY$="J" THEN GOSUB 5410
 4888 IF INKEY$="B" THEN GOSUB 3000
 4890 IF INKEY$="I" THEN GOSUB 3250
 4892 IF INKEY$="L" THEN GOSUB 5040
 4894 GOTO 4835
 4902 PRINT TAB 23;E$
 4904 GOTO 4930
 4910 PRINT 
 4912 GOTO 4930
 4930 LET SC=SC+1
 4932 IF INKEY$="S" AND INKEY$<>"A" THEN GOTO 4932
 4935 IF SC<22 THEN RETURN 
 4937 SLOW 
 4942 IF O1 THEN INPUT K$
 4950 IF O2 THEN COPY 
 4952 CLS 
 4955 LET SC=0
 4957 FAST 
 4960 RETURN 
 5030 REM *** OUTPUT ACCOUNTS ***
 5040 PRINT AT 21,0;"ACCOUNT NO. OR ALL?"
 5050 SLOW 
 5060 INPUT K$
 5070 IF K$="" THEN RETURN 
 5080 LET U=VAL K$
 5090 LET F=1
 5095 PRINT AT 18,0;"ACCT. NO. ";K$
 5100 PRINT ,,,,"MONTH DESIRED, JAN - DEC OR ALL?"
 5110 INPUT K$
 5120 FAST 
 5130 IF K$="" THEN RETURN 
 5135 CLS 
 5140 LET X=1
 5150 LET Y=99
 5160 IF U THEN LET X=U
 5170 IF U THEN LET Y=U
 5180 IF K$="ALL" THEN LET F=0
 5190 FOR U=X TO Y
 5200 IF N(U)=0 THEN GOTO 5380
 5210 LET AT=0
 5220 GOSUB C6
 5221 GOSUB C6
 5222 PRINT U;TAB 3;N$(U)
 5224 GOSUB C7
 5226 PRINT H$
 5228 GOSUB C7
 5230 LET N=0
 5240 LET N=N+1
 5250 IF N=I+1 THEN GOTO 5340
 5260 IF F AND A$(N,6 TO 8)<>K$ THEN GOTO 5240
 5270 IF VAL A$(N,23 TO 24)<>U AND VAL A$(N,25 TO 26)<>U THEN GOTO 5240
 5280 IF VAL A$(N,23 TO 24)=U THEN LET BN=A(N)
 5290 IF VAL A$(N,25 TO 26)=U THEN LET BN=-A(N)
 5300 LET AT=AT+BN
 5310 GOSUB A8
 5320 PRINT A$(N, TO 3);" ";A$(N,4 TO 10);" ";A$(N,11 TO 21);X$
 5322 GOSUB C7
 5330 GOTO 5240
 5340 GOSUB C5
 5350 LET BN=AT
 5360 GOSUB A8
 5370 PRINT "TOTAL";TAB 23;X$
 5372 GOSUB C7
 5380 NEXT U
 5382 LET SC=22
 5384 GOSUB C7
 5390 RETURN 
 5410 PRINT AT 18,0;"START WHERE? ";
 5420 SLOW 
 5430 INPUT K$
 5440 IF K$="" THEN RETURN 
 5450 LET X=VAL K$
 5460 PRINT ,X
 5470 PRINT ,,"END WHERE?";
 5480 INPUT K$
 5490 LET Y=VAL K$
 5500 PRINT ,Y
 5510 PAUSE 20
 5511 FAST 
 5512 POKE 16518,0
 5513 POKE 16528,182
 5514 POKE 16529,2
 5521 CLS 
 5522 LET SC=0
 5524 FOR N=X TO Y
 5526 IF N>I THEN GOTO 5550
 5528 LET P=N
 5530 GOSUB A3
 5532 NEXT N
 5550 LET SC=22
 5552 GOSUB C7
 5554 POKE 16518,199
 5555 POKE 16528,239
 5556 POKE 16529,1
 5557 RETURN 
 5561 FAST 
 5562 LET S=0
 5563 LET CX=1
 5564 CLS 
 5565 GOSUB D6
 5566 LET SC=5
 5567 GOSUB C7
 5568 PRINT H$
 5569 GOSUB C7
 5570 GOSUB C6
 5575 LET X=1
 5580 LET Y=18
 5590 GOSUB B9
 5592 LET SC=22
 5594 GOSUB C7
 5600 RETURN 
 5660 CLS 
 5665 PRINT "CATEGORY GROUP          ACCOUNTS","         FROM TO"
 5670 PRINT AT 2,0;"ASSETS";AT 6,0;"LIABIL";AT 9,0;"CAPITAL";AT 10,0;"INCOME";AT 13,0;"EXPENSE"
 5680 PRINT AT 2,0;
 5690 FOR N=1 TO 18
 5700 PRINT TAB 9;N;TAB 12;C$(N, TO 12);TAB 26;C$(N,13 TO 14);TAB 30;C$(N,15 TO 16)
 5710 NEXT N
 5720 PRINT AT 21,0;"CHANGE WHICH GROUP?"
 5730 SLOW 
 5740 INPUT K$
 5750 IF K$="" THEN RETURN 
 5760 PRINT AT 21,0;G$
 5770 LET Y=VAL K$
 5790 PRINT AT 1+Y,11;"%?"
 5800 INPUT K$
 5810 IF K$="" THEN GOTO 5830
 5820 LET C$(Y)=K$
 5830 PRINT AT 1+Y,11;C$(Y, TO 12);TAB 26;"%?"
 5840 INPUT K$
 5850 IF K$="" THEN GOTO 5870
 5860 LET C$(Y,13 TO 14)=K$
 5870 PRINT AT 1+Y,26;C$(Y,13 TO 14);TAB 30;"%?"
 5880 INPUT K$
 5890 IF K$="" THEN GOTO 5910
 5900 LET C$(Y,15 TO )=K$
 5910 PRINT AT 1+Y,30;C$(Y,15 TO )
 5920 GOTO 5720
 6172 CLS 
 6174 GOSUB D6
 6176 PRINT P$
 6190 RETURN 
 6210 IF INKEY$="J" THEN GOTO 40
 6215 IF INKEY$="M" THEN GOTO 130
 6220 IF INKEY$="N" THEN GOSUB 2720
 6225 IF INKEY$="G" THEN GOSUB 5660
 6230 IF INKEY$="C" THEN COPY 
 6235 IF INKEY$="O" THEN GOSUB 4835
 6240 IF INKEY$="E" THEN GOSUB 2190
 6250 IF INKEY$="Q" THEN GOTO 6840
 6260 IF INKEY$="T" THEN GOSUB 6600
 6270 IF INKEY$="S" THEN GOTO 6740
 6290 IF CODE INKEY$=112 THEN GOSUB 2780
 6300 IF CODE INKEY$=113 THEN GOSUB 2860
 6310 GOTO 170
 6330 CLS 
 6340 GOSUB D6
 6350 PRINT Q$
 6410 IF INKEY$="L" THEN GOTO 0120
 6420 IF INKEY$="C" THEN COPY 
 6430 IF INKEY$="B" THEN GOSUB 1990
 6440 IF INKEY$="E" THEN GOSUB 750
 6450 IF INKEY$="F" THEN GOSUB 3660
 6460 IF INKEY$="M" THEN GOTO 30
 6470 IF INKEY$="O" THEN GOSUB 4830
 6490 IF INKEY$="S" THEN GOTO 6740
 6500 IF INKEY$="R" THEN GOSUB 4210
 6510 IF INKEY$="Q" THEN GOTO 6840
 6520 IF CODE INKEY$=112 THEN GOSUB 4100
 6530 IF CODE INKEY$=113 THEN GOSUB 4150
 6540 GOTO 80
 6550 REM SHORT SUB
 6560 PRINT L$;H$;O$(1);O$(2);O$(3);H$
 6570 RETURN 
 6605 PRINT AT 21,0;"        "
 6606 SLOW 
 6607 PRINT AT 2,0;"%?"
 6610 INPUT K$
 6615 IF K$="" THEN GOTO 6625
 6620 LET O$(1)=K$
 6625 PRINT AT 2,0;O$(1);"%?"
 6635 INPUT K$
 6640 IF K$="" THEN GOTO 6650
 6645 LET O$(2)=K$
 6650 PRINT AT 3,0;O$(2);"%?"
 6655 INPUT K$
 6660 IF K$="" THEN GOTO 6670
 6665 LET O$(3)=K$
 6670 PRINT AT 4,0;O$(3)
 6675 RETURN 
 6750 RAND USR UP
 6760 PRINT AT 21,0;"SAVE BOOKS?"
 6770 SLOW 
 6780 INPUT K$
 6790 FAST 
 6800 PRINT AT 21,0;G$
 6810 IF K$<>"Y" THEN GOTO 80
 6820 SAVE "BOOK%S"
 6830 GOTO 30
 6850 CLS 
 6890 LIST 
 7020 DIM A$(A,27)
 7030 DIM A(A)
 7040 DIM N(99)
 7050 DIM B$(99,9)
 7060 LET I=0
 7070 LET QJ=I
 7090 LET R=I
 7100 LET CN=I
 7110 GOTO 30

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top