130 SP$ = CHR$(9) +"80N": REM PRINTER DE-INIT STRING
140 D$ = CHR$(4)
150 DIM BL$(3),NA$(40),NU$(40,12),T$(19),MN$(12)
160 FOR X = 1 TO 39:BL$(1) = BL$(1) +" ":BL$(2) = BL$(2) +"=":BL$(3) = BL$(3) +"-": NEXT :I$ = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC": FOR X = 1 TO 12:MN$(X) = MID$ (I$,(X *3) -2,3): NEXT
170 FOR X = 1 TO 15:MN$(0) = MN$(0) +" ": NEXT : FOR X = 1 TO 19: READ T$(X): NEXT :T8 = 3
180 DATA WORK WITH DATA,CHANGE DISK INFO.,LOAD DATA FILE,SAVE DATA FILE,PRINT THE DATA,QUIT PROGRAM,DISK SLOT #,DISK DRIVE #,DATA FILE NAME,CATALOG DISK,ENTER/VIEW DATA,ENTER/CHANGE NAMES,VIEW DATA GRAPHS
190 DATA VIEW TOTALS FOR ANY MONTH,VIEW YEAR TO DATE TOTALS,ALL CATEGORIES,ONE CATEGORY,TOTALS FOR A MONTH,TOTALS YEAR TO DATE
730 TEXT : HOME : HTAB 10: PRINT "BILL KEEPER--MAIN MENU": HTAB 10: PRINT LEFT$(BL$(2),22):T = 1:T1 = -2:T2 = 0:T3 = 1:T4 = 6:T5 = 0: FOR X = 1 TO 6: GOSUB 520: NEXT : GOSUB 540:X = T8: GOSUB 580
740 T8 = X: ON X GOTO 760,780,2640,2640,810,2750
750 REM *** WORKING MENU ***
760 POKE 35,19: HOME : HTAB 14: PRINT "WORKING MENU":T1 = 8: TEXT : GOSUB 540: POKE 34,2: POKE 35,15: HOME :T1 = -2:T2 = 10:T3 = 1:T4 = 5:T5 = 0: FOR X = 1 TO 5: GOSUB 520: NEXT :X = 1: GOSUB 580: TEXT : ON X GOTO 1090,1090,1090,1440,1550
770 REM *** CHANGE INFO MENU ***
780 POKE 35,19: HOME : HTAB 9: PRINT "CHANGE DISK INFO. MENU":T1 = 8
790 TEXT : GOSUB 540: POKE 34,2: POKE 35,15: HOME :T1 = -3:T2 = 6:T3 = 1:T4 = 4:T5 = 0: FOR X = 1 TO 4: GOSUB 520: NEXT :X = 1: GOSUB 580: ON X GOTO 2390,2400,2410,2590
800 REM *** PRINT DATA MENU ***
810 POKE 35,19: HOME : HTAB 13: PRINT "PRINT DATA MENU":T1 = 8: TEXT : GOSUB 540: POKE 34,2: POKE 35,15: HOME :T1 = -3:T2 = 15:T3 = 1:T4 = 4:T5 = 0: FOR X = 1 TO 4: GOSUB 520: NEXT :X = 1: GOSUB 580
820 TEXT : HOME : VTAB 10: HTAB 3: PRINT "TURN ON PRINTER THEN PRESS ";: INVERSE : PRINT "<RETURN>";: NORMAL : VTAB 13: HTAB 3: PRINT "OR PRESS ";: INVERSE : PRINT "<ESCAPE>";: NORMAL : PRINT " TO RETURN TO MENU"
830 GOSUB 290: IF K = 27 THEN 810
840 IF K < >13 THEN 830
850 ON X GOTO 870,1020,1050,1070
860 REM *** PRINT ALL FILES ***
870 X = 1: HOME : VTAB 10: HTAB 13: PRINT "PRINTING DATA": GOSUB 380
880 IF X >40 THEN 1000
890 IF LEN(NA$(X)) = 0 OR NA$(X) = MN$(0) THEN X = X +1: GOTO 880
900 Y = X +1
910 IF Y >40 THEN 930
920 IF LEN(NA$(Y)) = 0 THEN Y = Y +1: GOTO 910
930 HTAB 3: PRINT NA$(X);: IF Y <41 THEN HTAB 22: PRINT NA$(Y)
940 PRINT : FOR Z = 1 TO 12: HTAB 6: PRINT MN$(Z);: HTAB 18 - LEN(NU$(X,Z)): PRINT NU$(X,Z);: IF Y <41 THEN HTAB 25: PRINT MN$(Z);: HTAB 37 - LEN(NU$(Y,Z)): PRINT NU$(Y,Z)
950 IF Y >40 THEN PRINT
960 NEXT : PRINT : HTAB 2: PRINT LEFT$(BL$(3),16);: IF Y <41 THEN HTAB 21: PRINT LEFT$(BL$(3),16)
970 IF Y >40 THEN PRINT
980 HTAB 2: PRINT "TOTAL";: HTAB 18 - LEN(NU$(X,0)): PRINT NU$(X,0);: IF Y <41 THEN HTAB 21: PRINT "TOTAL";: HTAB 37 - LEN(NU$(Y,0)): PRINT NU$(Y,0)
2040 FOR Z = 1 TO 12: IF VAL(NU$(L,Z)) >Y THEN Y = Y *2: GOTO 2040
2050 NEXT : FOR Z = 1 TO 12: HTAB 30: VTAB (Z +5): PRINT LEFT$(MN$(Z),1);: HTAB 40 - LEN(NU$(L,Z)): PRINT NU$(L,Z): NEXT :T = INT(Y/10):T2 = T: FOR Z = 10 TO 1 STEP -1: HTAB 1: VTAB (Z *2): PRINT T2:T2 = T2 +T: NEXT
2060 VTAB 22: HTAB 1: PRINT "0": FOR Z = 1 TO 12: VTAB 23: HTAB (Z *2) +5: PRINT LEFT$(MN$(Z),1);: NEXT : FOR Z = 1 TO 12: HTAB (Z *2) +5: IF VAL(NU$(L,Z)) = 0 THEN VTAB 22: GOTO 2080
2270 VA = (Y <16) AND (K = 13 OR K = 27 OR K >31): ON NOT VA GOTO 2130:I$ = I$ + CHR$(K): VTAB 15: HTAB (11 +Y): PRINT CHR$(K);: POKE -16368,0:Y = Y +1: GOTO 2180
2280 FOR Y = 1 TO 15 - LEN(I$):I$ = I$ +" ": NEXT
2290 IF I$ = "" OR I$ = " " OR I$ = MN$(0) THEN I$ = "": GOTO 1090
2300 IF NA$(L) = "" THEN 2360
2310 HOME : VTAB 8: HTAB 4: PRINT "DO YOU WISH TO KEEP ANY DATA THAT": HTAB 4: PRINT "WAS STORED UNDER THE OLD TITLE.": PRINT : HTAB 12: PRINT NA$(L): NORMAL : PRINT : HTAB 13: PRINT "PRESS Y OR N"
2320 GOSUB 300: IF K = 89 OR K = 121 THEN 2370
2330 IF K = 27 THEN 1090
2340 IF K = 78 OR K = 110 THEN 2360
2350 GOTO 2320
2360 FOR Z = 0 TO 12:NU$(L,Z) = "0.00": NEXT
2370 NA$(L) = I$:SA = 1: GOTO 1090
2380 REM *** CHANGE INFO ***
2390 X = SL: HOME : GOSUB 570: VTAB 5: HTAB 9: PRINT "THE CURRENT SLOT IS #";X:T1 = 8:T3 = 4:T4 = 7:T5 = 51:T6 = 56:T7 = 30: GOSUB 580:SL = X:T5 = 0: GOTO 790
2400 X = DR: HOME : VTAB 5: HTAB 9: PRINT "THE CURRENT DRIVE IS #";X:T1 = 8:T3 = 1:T4 = 2:T5 = 48:T6 = 51:T7 = 31: GOSUB 580:DR = X:T5 = 0: GOTO 790
2410 POKE 35,19: HOME : VTAB 5: PRINT "ENTER A FILENAME TO SAVE DATA ON DISK": PRINT : PRINT "USE 15 OR FEWER CHARACTERS IN THE NAME": VTAB 16: INVERSE : PRINT "<RETURN>";: NORMAL : PRINT " TO ACCEPT THE CURRENT FILE NAME"
2420 I$ = "":Y = 1
2430 GOSUB 290: IF K >64 AND K <91 THEN 2520
2440 ON Y = 1 GOTO 2460: IF K = 47 THEN PRINT CHR$(7);: POKE -16368,0: GOTO 2430
2450 IF K >45 AND K <58 THEN 2520
2460 IF K = 13 THEN 2530
2470 IF K = 27 THEN 2540
2480 IF K < >8 THEN 2430
2490 POKE -16368,0: IF Y < = 2 THEN Y = 1:I$ = "": GOTO 2510
2520 I$ = I$ + CHR$(K): VTAB 10: HTAB 11 +Y: PRINT CHR$(K);: POKE -16368,0: IF Y <15 THEN Y = Y +1: GOTO 2430
2530 IF I$ < >"" THEN DF$ = I$
2540 T1 = 8: VTAB 16: PRINT SPC( 40): GOTO 790
2550 HOME : VTAB 5: HTAB 5: INVERSE : PRINT I$: NORMAL : PRINT : PRINT "IS NOT A VALID FILENAME": PRINT : PRINT "PRESS ";: INVERSE : PRINT "<ESCAPE>": NORMAL
2560 GOSUB 300: IF K < >27 THEN 2560
2570 GOTO 2410
2580 REM *** CATALOG ***
2590 I$ = "CATALOG": IF PEEK(48896) = 76 THEN I$ = "CAT"
2600 TEXT : HOME : PRINT D$;I$;",S";SL;",D";DR: PRINT : PRINT "PRESS ";: INVERSE : PRINT "<RETURN>": NORMAL : PRINT
2610 GOSUB 300: IF K = 13 OR K = 27 THEN T1 = 0: GOTO 780
2620 GOTO 2610
2630 REM *** SAVE & LOAD DATA ***
2640 T2 = X: TEXT : HOME : PRINT D$;"VERIFY";DF$;",S";SL;",D";DR: GOTO 2680
2650 HOME : VTAB 10: HTAB 5: INVERSE : PRINT DF$: NORMAL : PRINT : HTAB 5: PRINT "DOES NOT EXIST ON THIS DISK"
2660 IF T2 = 4 THEN PRINT : HTAB 5: PRINT "DO YOU WISH TO OPEN THIS FILE": PRINT : HTAB 5: PRINT "PRESS Y OR N":T1 = 8: GOSUB 330: GOTO 2700
2670 PRINT : HTAB 5: PRINT "PRESS ";: INVERSE : PRINT "<RETURN>";: NORMAL : PRINT " TO CONTINUE": GOSUB 300: HOME : VTAB 10: HTAB 15: PRINT "WORKING": FOR X = 1 TO 40: FOR Y = 0 TO 12:NU$(X,Y) = "0.00": NEXT Y,X: GOTO 2720
2680 IF T2 = 3 THEN 2700
2690 VTAB 10: HTAB 5: INVERSE : PRINT DF$: NORMAL : PRINT : HTAB 5: PRINT "ALREADY EXISTS ON THIS DISK": PRINT : HTAB 5: PRINT "DO YOU WISH TO SAVE THIS FILE ANYWAY": PRINT : HTAB 5: PRINT "PRESS Y OR N":T1 = 8: GOSUB 330
2700 HOME : VTAB 10: HTAB 10: IF T2 = 4 THEN 2730
2710 PRINT "LOADING ";DF$: PRINT D$;"OPEN";DF$;",S";SL;",D";DR: PRINT D$;"READ";DF$: FOR X = 1 TO 40: INPUT NA$(X): FOR Y = 0 TO 12: INPUT NU$(X,Y): NEXT Y,X: PRINT D$;"CLOSE"
2720 T8 = 1: GOTO 730
2730 PRINT "SAVING ";DF$: PRINT D$;"OPEN";DF$",S"SL",D"DR: PRINT D$;"WRITE";DF$: FOR X = 1 TO 40: PRINT NA$(X): FOR Y = 0 TO 12: PRINT NU$(X,Y): NEXT Y,X: PRINT D$;"CLOSE":SA = 0: GOTO 730
2740 REM *** QUIT ***
2750 HOME : IF SA = 1 THEN VTAB 10: HTAB 7: PRINT "YOU HAVE NOT SAVED YOUR DATA.": PRINT : HTAB 7: PRINT "DO YOU WISH TO QUIT ANYWAY ?": PRINT : HTAB 14: PRINT "PRESS Y OR N":T1 = 8: GOSUB 330
2760 HOME : VTAB 10: HTAB 8: PRINT "DO YOU REALLY WISH TO QUIT": PRINT : HTAB 15: PRINT "PRESS Y OR N":T1 = 8: GOSUB 330: HOME : END
2770 PRINT D$"PR#0": REM ERROR TRAP
2780 T = PEEK(222):I$ = "AN ERROR HAS OCCURED"
2790 IF T = 11 THEN I$ = "INVALID FILE NAME"
2800 IF T = 10 THEN I$ = "FILE IS LOCKED"
2810 IF T = 9 THEN I$ = "DISK IS FULL"
2820 IF T = 8 THEN I$ = "CHECK DRIVE DOOR OR DISK"
2830 IF T = 6 THEN 2650
2840 IF T = 5 THEN PRINT D$;"CLOSE";DF$: GOTO 730
2850 IF T = 4 THEN I$ = "REMOVE WRITE PROTECT TAB"
2860 TEXT : HOME : VTAB 10: HTAB 5: PRINT I$: VTAB 12: HTAB 5: PRINT "PRESS ";: INVERSE : PRINT "<RETURN>";: NORMAL : PRINT " FOR MENU"