This is a personal checking account management program offering nine functions: entering deposits, viewing deposits, entering checks, listing accounts, listing checks, viewing balances, saving to tape, searching for checks, and entering interest or service charges. The program maintains up to 80 checks across parallel arrays — W$ (payee names), R (amounts), E (check numbers), and Q$ (dates) — alongside up to 25 deposit records and 80 account summary records. Check amounts are rounded to the nearest cent using the INT(U*100+0.5)/100 idiom at line 1560. The search routine at line 2280 supports lookup by check number, date, payee name, or amount using a single pass through the check arrays.
Program Analysis
Program Structure
The program is organized as a menu-driven application with a central dispatch loop at lines 350–580. After initialization (lines 10–230) and a title screen (lines 240–340), the main menu offers nine options routed via INKEY$ polling. Each major function occupies a distinct line range:
| Lines | Function |
|---|---|
| 590–710 | Enter deposits |
| 720–940 | View deposits |
| 950–1260 | List accounts |
| 1270–1790 | Enter checks |
| 1800–2160 | List checks |
| 2170–2270 | Save to tape |
| 2280–3010 | Search for a check |
| 3020–3270 | Enter interest / service charges |
| 3280–3380 | View balance |
Data Storage
All data is held in parallel arrays allocated at startup. The program supports up to 80 checks and 25 deposits. Key arrays include:
W$(80,25)— payee names for checksR(80)— check amountsE(80)— check numbersQ$(80,8)— check datesI$(80,25)— account names (unique payees)I(80)— cumulative amount per accountD$(25,8)— deposit datesW(25)— deposit amountsP(80)— check numbers per account (allocated but largely unused in display)
The account deduplication logic (lines 1630–1780) scans I$ for a matching payee name prefix of length K (the length of the current payee string). If found, it accumulates the amount into the existing account entry; otherwise it creates a new entry. The flag variable F distinguishes new versus existing accounts for subsequent check entries when the payee field is left blank.
Key BASIC Idioms
Menu navigation uses INKEY$ polling loops (e.g., lines 470–480) rather than INPUT, which avoids requiring the user to press Enter for single-character selections. The deposit and check listing routines offer both screen listing and printer output controlled by the P$ variable, with LPRINT statements conditional on P$="P".
The rounding at line 1560 uses the idiom INT(U*100)/100 after adding 0.005 at line 1550, implementing standard half-up rounding to two decimal places for the running check total.
Search Routine
The search function (lines 2630–2850) performs a linear scan through all 80 check records. The search field is selected before entering the loop: CN for check number, X$ for date, Y$ for name, AM for amount. String searches use a prefix slice of length K (set to the length of the search term) stored in V$, computed inside the loop at lines 2690–2700. All four match conditions are tested independently with separate IF statements, meaning a record matching any active criterion will be displayed — the conditions are logically OR’d rather than AND’d.
Notable Techniques and Anomalies
- Variable
AMis initialized twice: at line 60 and again at line 200.INTis used as a variable name at line 210 to store cumulative interest, shadowing the built-inINTfunction — this works on ZX81/TS1000 BASIC but is confusing and could cause issues ifINTis used as a function elsewhere. - The variable name
INat line 170 and again at line 3240 stores interest input, similarly shadowing theINkeyword used inFOR...TO...STEPconstructs on some dialects. - At line 2680,
IF E(J)=0 THEN NEXT Jis used to skip empty check slots. This is a valid early-exit idiom but means check number 0 can never be legitimately stored, consistent with the entry validation at line 1340. - The deposit listing loop at lines 800–930 uses
X=25(line 780) and iteratesYfrom 1 to 24 in steps of 20, producing two pages of up to 20 entries each. The guard at line 840 exits cleanly ifZreaches 26. - Lines 3500–3510 appear after the logical end of the program. Line 3500 saves the program to tape with a filename containing an inverse-video character; line 3510 restarts from line 10.
- The
GOTO 0350at line 580 handles any menu key outside ‘1’–’9′ by returning to the menu, but the conditionM$>"9"only catches characters with codes above ‘9’; digits below ‘1’ and non-numeric characters below ‘9’ in ASCII order are not caught and fall through to line 580 anyway due to none of the prior conditionals matching.
Balance Calculation
The program tracks a single running deposit total V and a running check total U. Service charges decrement V (line 3200) while interest increments it (line 3250). The displayed balance is always computed as V-U rather than maintained as a separate variable, which is arithmetically correct given the update logic but means the balance display (lines 3300, 1570) depends on both accumulators being current.
Content
Source Code
10 LET U=0
20 LET V=0
30 LET D=0
40 LET N=0
50 LET B=0
60 LET AM=0
70 LET F=0
80 DIM I(80)
90 LET J=0
100 DIM D$(25,8)
110 DIM E(80)
120 DIM W$(80,25)
130 DIM Q$(80,8)
140 DIM R(80)
150 DIM W(25)
160 DIM I$(80,25)
170 LET IN=0
180 DIM P(80)
190 LET CN=0
200 LET AM=0
210 LET INT=0
220 LET SC=0
230 LET SCT=0
240 CLS
250 PRINT AT 2,8; "ZX81/TIMEX 1000"
260 PRINT AT 3,11;"CHECKING"
270 PRINT AT 4,14;"BY"
280 PRINT AT 5,4;"HEATH COMPUTER SERVICES"
290 PRINT AT 6,7;"950 EAST 52 SOUTH"
300 PRINT AT 7,9;"GREENTOWN IN."
310 PRINT AT 8,12;"46936"
320 PRINT AT 10,9;"COPYRIGHT 1982"
330 PRINT AT 12,6;"PRESS <ENTER> TO RUN"
340 INPUT S$
350 CLS
360 PRINT AT 2,6;"DO YOU WANT TO--"
370 PRINT AT 4,3;"(1)ENTER DEPOSITS"
380 PRINT AT 5,3;"(2)LOOK AT DEPOSITS"
390 PRINT AT 6,3;"(3)ENTER CHECKS"
400 PRINT AT 7,3;"(4)LIST ACCOUNTS"
410 PRINT AT 8,3;"(5)LIST CHECKS"
420 PRINT AT 9,3;"(6)LOOK AT BALANCE"
430 PRINT AT 10,3;"(7)SAVE ON TAPE"
440 PRINT AT 11,3;"(8)SEARCH FOR A CHECK"
450 PRINT AT 12,3;"(9)ENTER INTEREST AND SERVICE CHARGES"
460 PRINT AT 16,5;"PRESS NO. 1-9"
470 LET M$=INKEY$
480 IF M$="" THEN GOTO 0470
490 IF M$="1" THEN GOTO 0590
500 IF M$="2" THEN GOTO 0720
510 IF M$="3" THEN GOTO 1270
520 IF M$="4" THEN GOTO 0950
530 IF M$="5" THEN GOTO 1800
540 IF M$="6" THEN GOTO 3280
550 IF M$="7" THEN GOTO 2170
560 IF M$="8" THEN GOTO 2280
570 IF M$="9" THEN GOTO 3020
580 IF M$>"9" THEN GOTO 0350
590 CLS
600 LET N=N+1
610 PRINT
620 PRINT "PRESS <ENTER> WHEN FINISHED."
630 PRINT "ENTER DATE ?/?/?"
640 INPUT G$
650 IF G$="" THEN LET N=N-1
660 IF G$="" THEN GOTO 0350
670 LET D$(N)=G$
680 PRINT "ENTER AMOUNT OF DEPOSIT"
690 INPUT W(N)
700 LET V=V+W(N)
710 GOTO 0590
720 CLS
730 PRINT
740 PRINT "PRESS (P) TO PRINT (L) TO LIST"
750 LET P$=INKEY$
760 IF P$="" THEN GOTO 0750
770 CLS
780 LET X=25
790 IF P$="P" THEN LPRINT "DATE";,"AMOUNT"
800 FOR Y=1 TO X-1 STEP 20
810 PRINT "DATE";,"AMOUNT"
820 FOR Z=Y TO Y+19
830 IF P$="P" AND D$(Z)=" " THEN GOTO 0350
840 IF Z=26 THEN GOTO 0880
850 PRINT D$(Z),"$";W(Z)
860 IF P$="P" THEN LPRINT D$(Z),"$";W(Z)
870 NEXT Z
880 PRINT " PRESS (L) TO LIST (M) FOR MENU."
890 LET C$=INKEY$
900 IF C$="" THEN GOTO 0890
910 IF C$="M" THEN GOTO 0350
920 CLS
930 NEXT Y
940 GOTO 0350
950 CLS
960 PRINT AT 9,0;"PRESS (P) TO PRINT (L) TO LIST"
970 LET P$=INKEY$
980 IF P$="" THEN GOTO 0970
990 IF P$="L" THEN GOTO 1020
1000 IF P$="P" THEN GOTO 1020
1010 GOTO 0970
1020 FOR O=1 TO 80 STEP 9
1030 CLS
1040 PRINT
1050 PRINT "ACCOUNT";TAB (23);"AMOUNT"
1060 IF P$="L" THEN GOTO 1100
1070 LPRINT
1080 LPRINT "ACCOUNT";TAB (23);"AMOUNT"
1090 LPRINT
1100 FOR Q=O TO O+8
1110 IF P$="L" THEN GOTO 1150
1120 IF I$(Q)=" " THEN GOTO 0350
1130 LPRINT I$(Q)
1140 LPRINT TAB (22);"$";I(Q)
1150 PRINT I$(Q)
1160 PRINT TAB (22);"$";I(Q)
1170 IF Q=80 THEN GOTO 1200
1180 NEXT Q
1190 IF P$="P" THEN GOTO 1240
1200 PRINT "PRESS (L) TO LIST (M) FOR MENU."
1210 LET C$=INKEY$
1220 IF C$="" THEN GOTO 1210
1230 IF C$="M" THEN GOTO 0350
1240 CLS
1250 NEXT O
1260 GOTO 0350
1270 CLS
1280 PRINT AT 14,1;"ACCOUNT THE SAME PRESS ENTER."
1290 PRINT "ENTER ACCOUNT NAME."
1300 INPUT K$
1310 PRINT " ENTER (0) WHEN FINISHED."
1320 PRINT "ENTER CHECK NO."
1330 INPUT X
1340 IF X=0 THEN GOTO 0350
1350 PRINT "ENTER DATE ?/?/?"
1360 INPUT L$
1370 IF L$="" THEN GOTO 1350
1380 IF K$<>"" THEN GOTO 1410
1390 IF F=1 THEN LET K$=I$(J)
1400 IF K$="" THEN LET K$=I$(D)
1410 PRINT "AMOUNT OF CHECK?"
1420 LET K=LEN K$
1430 INPUT L
1440 CLS
1450 PRINT
1460 PRINT "DATE ";L$
1470 PRINT
1480 PRINT AT 2,2;"CHECK NUMBER ";X
1490 PRINT
1500 PRINT "TO ";K$
1510 PRINT
1520 PRINT "CHECK";TAB (12);"TOTAL"
1530 PRINT "AMOUNT";TAB (12);"CHECKS";TAB (23);"BALANCE"
1540 LET U=U+L
1550 LET U=U+.005
1560 LET U=INT (U*100)/100
1570 PRINT "$";L;TAB (12);"$";U;TAB (23);"$";V-U
1580 LET B=B+1
1590 LET W$(B)=K$
1600 LET R(B)=L
1610 LET E(B)=X
1620 LET Q$(B)=L$
1630 FOR J=1 TO 80
1640 IF J>B THEN GOTO 1680
1650 LET A$=I$(J)(1 TO K)
1660 IF K$=A$ THEN GOTO 1760
1670 NEXT J
1680 LET D=D+1
1690 IF D=81 THEN GOTO 0350
1700 REM I$=ACCOUNT,P=CHECK NO.,I=AMOUNT
1710 LET I$(D)=K$
1720 LET P(D)=X
1730 LET I(D)=L
1740 LET F=0
1750 GOTO 1790
1760 LET I(J)=I(J)+L
1770 LET H=J
1780 LET F=1
1790 GOTO 1280
1800 CLS
1810 PRINT AT 9,0;"PRESS (P) TO PRINT (L) TO LIST"
1820 LET P$=INKEY$
1830 IF P$="" THEN GOTO 1820
1840 IF P$="L" THEN GOTO 1870
1850 IF P$="P" THEN GOTO 1870
1860 GOTO 1820
1870 FOR Y=1 TO 80 STEP 9
1880 CLS
1890 PRINT
1900 PRINT " DATE NO. AMOUNT"
1910 PRINT
1920 IF P$="L" THEN GOTO 1960
1930 LPRINT
1940 LPRINT " DATE NO. AMOUNT"
1950 LPRINT
1960 FOR Z=Y TO Y+8
1970 IF Z>80 THEN GOTO 2130
1980 IF P$="L" THEN GOTO 2030
1990 IF W$(Z)=" " THEN GOTO 0350
2000 LPRINT W$(Z)
2010 LPRINT Q$(Z);TAB (11);E(Z);TAB (21);"$";R(Z)
2020 GOTO 2050
2030 PRINT W$(Z)
2040 PRINT Q$(Z);TAB (11);E(Z);TAB (21);"$";R(Z)
2050 NEXT Z
2060 IF P$="P" THEN GOTO 2110
2070 PRINT "PRESS (L) TO LIST (M) FOR MENU"
2080 LET C$=INKEY$
2090 IF C$="" THEN GOTO 2080
2100 IF C$="M" THEN GOTO 0350
2110 CLS
2120 NEXT Y
2130 PRINT
2140 PRINT "PRESS <ENTER> FOR MENU"
2150 INPUT C$
2160 GOTO 0350
2170 CLS
2180 PRINT
2190 PRINT "TYPE MONTH"
2200 PRINT
2210 PRINT "PRESS PLAY AND RECORD ON THE"
2220 PRINT "RECORDER"
2230 PRINT
2240 PRINT "PRESS (ENTER) WHEN READY"
2250 INPUT T$
2260 SAVE T$
2270 GOTO 0240
2280 CLS
2290 LET K=1
2300 PRINT
2310 LET X$=""
2320 LET Y$=""
2330 PRINT " PRESS:"
2340 PRINT
2350 PRINT "(C) TO SEARCH BY CHECK NUMBER"
2360 PRINT "(D) TO SEARCH BY DATE"
2370 PRINT "(N) TO SEARCH BY NAME"
2380 PRINT "(A) TO SEARCH BY AMOUNT"
2390 PRINT
2400 LET C$=INKEY$
2410 IF C$="" THEN GOTO 2400
2420 IF C$="C" THEN GOTO 2470
2430 IF C$="D" THEN GOTO 2510
2440 IF C$="N" THEN GOTO 2560
2450 IF C$="A" THEN GOTO 2610
2460 GOTO 2400
2470 PRINT "ENTER CHECK NUMBER"
2480 INPUT CN
2490 IF CN=0 THEN GOTO 2280
2500 GOTO 2630
2510 PRINT "ENTER DATE"
2520 INPUT X$
2530 IF X$="" THEN GOTO 2280
2540 LET K=LEN X$
2550 GOTO 2630
2560 PRINT "ENTER NAME"
2570 INPUT Y$
2580 IF Y$="" THEN GOTO 2280
2590 LET K=LEN Y$
2600 GOTO 2630
2610 PRINT "ENTER AMOUNT"
2620 INPUT AM
2630 CLS
2640 PRINT
2650 PRINT
2660 FOR J=1 TO 80
2670 IF J=80 THEN GOTO 2780
2680 IF E(J)=0 THEN NEXT J
2690 IF C$="D" THEN LET V$=Q$(J)(1 TO K)
2700 IF C$="N" THEN LET V$=W$(J)(1 TO K)
2710 IF E(J)=CN THEN GOTO 2860
2720 IF V$=Y$ THEN GOTO 2860
2730 IF V$=X$ THEN GOTO 2860
2740 IF R(J)=AM THEN GOTO 2860
2750 NEXT J
2760 CLS
2770 PRINT
2780 PRINT "CHECK NOT LISTED"
2790 PRINT
2800 PRINT "PRESS (M) FOR MENU (S) TO SEARCH"
2810 LET C$=INKEY$
2820 IF C$="" THEN GOTO 2810
2830 IF C$="M" THEN GOTO 0350
2840 IF C$="S" THEN GOTO 2280
2850 GOTO 2810
2860 CLS
2870 PRINT
2880 PRINT "CHECK NO. ";E(J)
2890 PRINT "DATE ";Q$(J)
2900 PRINT "TO ";W$(J)
2910 PRINT "AMOUNT $";R(J)
2920 PRINT
2930 LET CN=0
2940 LET Y$=""
2950 LET X$=""
2960 LET AM=0
2970 PRINT "PRESS (M) FOR MENU (S) TO SEARCH"
2980 LET C$=INKEY$
2990 IF C$="" THEN GOTO 2980
3000 IF C$="M" THEN GOTO 0350
3010 IF C$="S" THEN GOTO 2280
3020 CLS
3030 PRINT
3040 PRINT "PRESS -"
3050 PRINT
3060 PRINT
3070 PRINT "(S) TO ENTER SERVICE CHARGE"
3080 PRINT "(I) TO ENTER INTEREST"
3090 PRINT "(M) FOR MENU"
3100 PRINT
3110 LET C$=INKEY$
3120 IF C$="" THEN GOTO 3110
3130 IF C$="S" THEN GOTO 3180
3140 IF C$="I" THEN GOTO 3230
3150 IF C$="M" THEN GOTO 0350
3160 GOTO 3110
3170 PRINT
3180 PRINT "ENTER SERVICE CHARGE"
3190 INPUT SC
3200 LET V=V-SC
3210 LET SCT=SCT+SC
3220 GOTO 3020
3230 PRINT "ENTER INTEREST"
3240 INPUT IN
3250 LET V=V+IN
3260 LET INT=INT+IN
3270 GOTO 3020
3280 CLS
3290 PRINT AT 8,2;"TOTAL CHECKS";TAB (20);"BALANCE"
3300 PRINT TAB (5);"$";U;TAB (21);"$";V-U
3310 PRINT AT 14,0;"SERVICE CHARGES INTEREST"
3320 PRINT TAB (5);"$";SCT;TAB (21);"$";INT
3330 PRINT
3340 PRINT
3350 PRINT
3360 PRINT "PRESS <ENTER> FOR MENU"
3370 INPUT C$
3380 GOTO 0350
3500 SAVE "CHECKIN%G"
3510 GOTO 0010
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

