10 ' FOS Program Section 2
15 '
20 CLEAR:DIM Z#(36):ON ERROR GOTO 4710
22 '
23 ' Drive designation in Line 25 must equal designation in Line 65 of FOS Pgm.
24 '
25 DRIVE$="A"
26 '
30 KEY OFF:COLOR 7,0:K1%=0:GOSUB 4520
40 ON KEY(1) GOSUB 920:KEY(1) ON:ON KEY(2) GOSUB 940:KEY(2) ON
50 ON KEY(9) GOSUB 4640:ON KEY(10) GOSUB 4650
60 PRINT TAB(24)"FILE MAINTENANCE AND DATA ANALYSIS.
70 PRINT STRING$(80,196):LOCATE 5,1
80 PRINT" 1 - INITIALIZE a given FOS file. This is to be used the FIRST time
90 PRINT" you intend to use a file. For example, to start up your first
100 PRINT" checking account (Checking Account #1) you would run this option
110 PRINT" to initialize two files... Checking Account #1 Outstanding cks.
120 PRINT" and Checking Account #1 Canceled Cks.
130 PRINT
140 PRINT" 2 - ENLARGE a file already being used. For example, assume you are
150 PRINT" are using Checking Account #2 and in the process of entering
160 PRINT" data relative to a check you wrote, you receive the message:
170 PRINT" CHECKING ACCOUNT #2 OUTSTANDING CHECKS FILE FULL, you would use
180 PRINT" this option to add more space to that already existing file.
190 PRINT:PRINT" 3 - PLOT monthly expenses, by category, for any year, list
200 PRINT" expense totals, by category, during any period of time, or list
210 PRINT" tax related items over any period of time.":PRINT
220 PRINT" 9 - RETURN to main FOS menu.
230 PRINT:GOSUB 930
240 KB$=INKEY$:IF KB$="" THEN 240
250 IF K1%=1 THEN 310
260 IF KB$="1" THEN 1100
270 IF KB$="2" THEN 320
280 IF KB$="3" THEN 1590
290 IF KB$="9" THEN 310
300 BEEP:GOTO 240
310 CLS:LOCATE 10,25:PRINT"Loading FOS Program section 1...":CHAIN DRIVE$+":FOS"
320 CLOSE:K1%=0:CLS:PRINT TAB(30);:COLOR 31
330 PRINT "F I L E E N L A R G E R":COLOR 7:PRINT
340 PRINT" 0 - Checking account #1 (Outstanding checks)
350 PRINT" 1 - Checking account #1 (Canceled checks)
360 PRINT:PRINT" 2 - Checking account #2 (Outstanding checks)
370 PRINT" 3 - Checking account #2 (Canceled checks)
380 PRINT:PRINT" 4 - Checking account #3 (Outstanding checks)
390 PRINT" 5 - Checking account #3 (Canceled checks)
400 PRINT:PRINT" 8 - Special accounts
410 PRINT" 9 - Cash Expenditures":PRINT
420 PRINT" Enter file to be ENLARGED: ";
430 SOUND 1200,.5:INPUT"",KB$:IF K1%=1 THEN 20
440 IF LEN(KB$)<>1 THEN BEEP:GOTO 420
450 IF KB$="8" THEN GOSUB 1080:GOTO 550
460 IF KB$="9" THEN GOSUB 1000:GOTO 680
470 IF KB$="0" THEN GOSUB 1010:GOTO 680
480 IF KB$="2" THEN GOSUB 1020:GOTO 680
490 IF KB$="4" THEN GOSUB 1030:GOTO 680
500 IF KB$="1" THEN GOSUB 1050:GOTO 800
510 IF KB$="3" THEN GOSUB 1060:GOTO 800
520 IF KB$="5" THEN GOSUB 1070:GOTO 800
530 BEEP:PRINT:PRINT" Invalid file selected...":PRINT:GOSUB 950:GOTO 380
540 ' SPECIAL ACCOUNTS
550 PRINT:R%=1:GET#1,R%:IF A$="A" OR A$="B" THEN 570
560 IF A$="E" THEN 580 ELSE 640
570 R%=R%+1:GET#1,R%:IF A$="E" THEN 580 ELSE 570
580 PRINT" File presently has room for a total of" R%-1 " records.":PRINT
590 INPUT" How many ADDITIONAL records do you want space reserved for? ",KB%
600 IF K1%=1 THEN 320 ELSE KB%=KB%+R%:LSET A$="A"
610 FOR I=R% TO KB%:PUT#1,I:NEXT:LSET A$="E":PUT#1,KB%
620 PRINT:PRINT" File has now been enlarged per your request."
630 GOSUB 950:CLS:CLOSE:GOTO 320
640 PRINT:PRINT"You cannot ENLARGE this file because you have not INITIALIZED
650 PRINT"it yet. Please perform the INITIALIZE function.
660 CLOSE:GOSUB 950:GOTO 20
670 ' CASH EXPENDITURES AND CURRENT CHECKS
680 PRINT:R%=1:GET#1,R%:IF A$="A" OR A$="B" THEN 700
690 IF A$="E" THEN 710 ELSE 770
700 R%=R%+1:GET#1,R%:IF A$="E" THEN 710 ELSE 700
710 PRINT" File presently has room for a total of" R%-1 " records.":PRINT
720 INPUT" How many ADDITIONAL records do you want space reserved for? ",KB%
730 IF K1%=1 THEN 320 ELSE KB%=KB%+R%:LSET A$="A"
740 FOR I=R% TO KB%:PUT#1,I:NEXT:LSET A$="E":PUT#1,KB%
750 PRINT:PRINT" File has now been enlarged as requested."
760 GOSUB 950:CLS:CLOSE:GOTO 320
770 PRINT:PRINT"You cannot ENLARGE this file because you have not INITIALIZED
780 PRINT"it yet. Please perform the INITIALIZE function.
790 CLOSE:GOSUB 950:GOTO 20
800 PRINT:R%=1:GET#1,R%:IF A$="A" OR A$="B" THEN 820
810 IF A$="E" THEN 830 ELSE 890
820 R%=R%+1:GET#1,R%:IF A$="E" THEN 830 ELSE 820
830 PRINT" File presently has space for a total of" R%-1 " records.":PRINT
840 INPUT" How many ADDITIONAL records do you want space reserved for? ",KB%
850 IF K1%=1 THEN 320 ELSE KB%=KB%+R%:LSET A$="A"
860 FOR I=R% TO KB%:PUT#1,I:NEXT:LSET A$="E":PUT#1,KB%
870 PRINT:PRINT" File has now been enlarged as requested."
880 GOSUB 950:CLS:CLOSE:GOTO 320
890 PRINT:PRINT"You cannot ENLARGE this file because you have not INITIALIZED
900 PRINT"it yet. Please perform the INITIALIZE function.
910 CLOSE:GOSUB 950:GOTO 20
920 K1%=1:RETURN
930 LOCATE 23,30:COLOR 18:PRINT"Enter function desired: ";:COLOR 7:SOUND 800,.5:RETURN
940 COLOR 7,0:CLOSE:CLS:PRINT"Welcome to BASIC...":PRINT:END
950 COLOR 18:PRINT TAB(55)"Hit any key to continue..";:COLOR 7
960 KB$=INKEY$:IF KB$="" THEN 960 ELSE RETURN
970 OPEN DRIVE$+":SAVINGS1.FOS" AS 1 LEN=62:GOTO 990
980 OPEN DRIVE$+":SAVINGS2.FOS" AS 1 LEN=62
990 FIELD#1,1 AS A$,8 AS B$,8 AS C$,1 AS D$,8 AS E$,36 AS G$:RETURN
1000 OPEN DRIVE$+":CASHEXP.FOS" AS 1 LEN=59:GOTO 1040
1010 OPEN DRIVE$+":CHKCUR1.FOS" AS 1 LEN=59:GOTO 1040
1020 OPEN DRIVE$+":CHKCUR2.FOS" AS 1 LEN=59:GOTO 1040
1030 OPEN DRIVE$+":CHKCUR3.FOS" AS 1 LEN=59
1040 FIELD#1,1 AS A$,8 AS B$,8 AS C$,2 AS D$,2 AS E$,1 AS F$,37 AS G$:RETURN
1050 OPEN DRIVE$+":CHKCAN1.FOS" AS 1 LEN=59:GOTO 1040
1060 OPEN DRIVE$+":CHKCAN2.FOS" AS 1 LEN=59:GOTO 1040
1070 OPEN DRIVE$+":CHKCAN3.FOS" AS 1 LEN=59:GOTO 1040
1080 OPEN DRIVE$+":SPECIAL.FOS" AS 1 LEN=62
1090 FIELD#1,1 AS A$,8 AS B$,8 AS C$,1 AS D$,4 AS E$,40 AS G$:RETURN
1100 CLS:PRINT TAB(20);:COLOR 31:K1%=0
1110 PRINT "F I L E I N I T I A L I Z A T I O N":COLOR 7:PRINT
1120 PRINT" 0 - Checking account # 1 (Outstanding checks)
1130 PRINT" 1 - Checking account # 1 (Canceled checks)
1140 PRINT:PRINT" 2 - Checking account # 2 (Outstanding checks)
1150 PRINT" 3 - Checking account # 2 (Canceled checks)
1160 PRINT:PRINT" 4 - Checking account # 3 (Outstanding checks)
1170 PRINT" 5 - Checking account # 3 (Canceled checks)
1180 PRINT:PRINT" 6 - Savings account # 1
1190 PRINT" 7 - Savings account # 2
1200 PRINT:PRINT" 8 - Special accounts
1210 PRINT" 9 - Cash Expenditures":PRINT
1220 PRINT" Enter file to be INITIALIZED: ";
1230 SOUND 1300,.5:INPUT"",KB$:IF K1%=1 THEN 20
1240 IF LEN(KB$)<>1 THEN BEEP:GOTO 1220
1250 IF KB$="6" OR KB$="7" THEN 1300 ELSE PRINT
1260 PRINT " Enter the maximum number of records you will have in this file"
1270 PRINT " at any one time: ";
1280 INPUT"",KB%:IF K1%=1 THEN 1100
1290 IF KB%<2 THEN BEEP:GOTO 1260
1300 PRINT:COLOR 30:PRINT"CAUTION... This function will destroy any data ";
1310 PRINT"already in this file."
1320 COLOR 7,0:PRINT:SOUND 1600,2
1330 PRINT" If you are sure you want to continue... enter the word";
1340 PRINT" PROCEED: ";:INPUT"",KB1$
1350 IF K1%=1 THEN 1100
1360 IF KB1$="proceed" OR KB1$="PROCEED" THEN 1370 ELSE BEEP:GOTO 1330
1370 FILE%=VAL(KB$)
1380 IF KB$="8" THEN GOSUB 1080:GOTO 1490
1390 IF KB$="6" THEN GOSUB 970:GOTO 1510
1400 IF KB$="9" THEN GOSUB 1000:GOTO 1490
1410 IF KB$="7" THEN GOSUB 980:GOTO 1510
1420 IF KB$="0" THEN GOSUB 1010:GOTO 1530
1430 IF KB$="2" THEN GOSUB 1020:GOTO 1530
1440 IF KB$="4" THEN GOSUB 1030:GOTO 1530
1450 IF KB$="1" THEN GOSUB 1050:GOTO 1490
1460 IF KB$="3" THEN GOSUB 1060:GOTO 1490
1470 IF KB$="5" THEN GOSUB 1070:GOTO 1490
1480 BEEP:PRINT:PRINT" Invalid file selected...":PRINT:GOSUB 950:GOTO 1100
1490 LSET A$="A"
1500 FOR R%=1 TO KB%:PUT#1,R%:NEXT:LSET A$="E":PUT#1,R%:CLOSE:GOTO 1100
1510 LSET A$="A":LSET E$=MKD$(0):FOR R%=1 TO 21:PUT#1,R%:NEXT
1520 LSET A$="E":PUT#1,R%:CLOSE:GOTO 1100
1530 LSET A$="B":GOSUB 1580:LSET B$=FDATE$:LSET C$=MKD$(0):LSET D$=MKI$(1)
1540 LSET E$=MKI$(1):LSET F$="N":LSET G$="Previous balance.":PUT#1,1
1550 LSET A$="A":FOR R%=2 TO KB%:PUT#1,R%:NEXT:LSET A$="E"
1560 PUT#1,R%:CLOSE:GOTO 1100
1570 LSET H$="A"
1580 FDATE$=LEFT$(DATE$,2)+"-"+MID$(DATE$,4,2)+"-"+RIGHT$(DATE$,2):RETURN
1590 CLOSE:K1%=0:CLS:PRINT TAB(30)"D A T A A N A L Y S I S
1600 PRINT:PRINT:PRINT
1610 PRINT" 1 - Display monthly expenses for one category for an entire year.
1620 PRINT
1630 PRINT" 2 - Print monthly expenses for one category for an entire year.
1640 PRINT:PRINT:PRINT" 3 - Display tax deductable items.
1650 PRINT:PRINT" 4 - Print tax deductable items on printer.
1660 PRINT:PRINT:PRINT" 5 - Display total expenses by category.
1670 PRINT:PRINT" 6 - Print total expenses by category.
1680 GOSUB 930
1690 KB$=INKEY$:IF KB$="" THEN 1690
1700 IF K1%=1 THEN 20
1710 IF KB$="1" THEN B%=0:GOTO 1780
1720 IF KB$="2" THEN B%=1:GOTO 1780
1730 IF KB$="3" THEN A%=0:GOTO 3130
1740 IF KB$="4" THEN A%=1:GOTO 3310
1750 IF KB$="5" THEN B%=0:GOTO 3670
1760 IF KB$="6" THEN B%=1:GOTO 3670
1770 BEEP:GOTO 1690
1780 GOSUB 4520:PRINT" Enter two digits for the YEAR you want analyzed or just
1790 PRINT:PRINT" press ENTER to use the current year... ";
1800 INPUT KB2$:IF K1%=1 THEN 1590
1810 IF KB2$="" THEN KB2$=RIGHT$(DATE$,2):GOTO 1840
1820 IF LEN(KB2$)=2 THEN 1840
1830 BEEP:GOTO 1800
1840 CLS:GOSUB 4660:PRINT
1850 PRINT:PRINT"From the list above, select a category you would like plotted: ";
1860 INPUT KB%:IF K1%=1 THEN 1590
1870 IF KB%>9 AND KB%<46 THEN 1890
1880 BEEP:GOTO 1850
1890 M1#=0:M2#=0:M3#=0:M4#=0:M5#=0:M6#=0:M7#=0:M8#=0:M9#=0:M10#=0:M11#=0:M12#=0
1900 GOSUB 1010:GOSUB 2600:CLOSE:GOSUB 1020:GOSUB 2600:CLOSE:GOSUB 1030:GOSUB 2600
1910 CLOSE:GOSUB 1050:GOSUB 2600:CLOSE:GOSUB 1060:GOSUB 2600:CLOSE
1920 GOSUB 1070:GOSUB 2600:CLOSE:GOSUB 1000:GOSUB 2600:CLOSE
1930 RESTORE
1940 READ A%,KB1$:IF A%<>KB% THEN 1940
1950 GOSUB 2810:IF M13=0 THEN 2300 ELSE M15=M13/60
1960 GOSUB 1580
1970 IF B%=0 THEN 2020
1980 PRINT:BEEP:PRINT" Insure that the printer is ready...":GOSUB 4540
1990 IF K1%=1 THEN 1590 ELSE GOSUB 4520
2000 PRINT" Now printing requested data...
2010 LPRINT:LPRINT KB1$ " 19" KB2$ TAB(70) FDATE$:KB$=CHR$(163):GOTO 2320
2020 GOSUB 1580:CLS:PRINT KB1$" 19" KB2$ TAB(70) FDATE$:KB$=CHR$(205)
2030 PRINT:PRINT
2040 PRINT"Jan ";:PRINT USING"$$######,.##";M1#;
2050 PRINT TAB(20);STRING$((M1#/M15),KB$)
2060 PRINT"Feb ";:PRINT USING"$$######,.##";M2#;
2070 PRINT TAB(20);STRING$((M2#/M15),KB$)
2080 PRINT"Mar ";:PRINT USING"$$######,.##";M3#;
2090 PRINT TAB(20);STRING$((M3#/M15),KB$):PRINT
2100 PRINT"Apr ";:PRINT USING"$$######,.##";M4#;
2110 PRINT TAB(20);STRING$((M4#/M15),KB$)
2120 PRINT"May ";:PRINT USING"$$######,.##";M5#;
2130 PRINT TAB(20);STRING$((M5#/M15),KB$)
2140 PRINT"Jun ";:PRINT USING"$$######,.##";M6#;
2150 PRINT TAB(20);STRING$((M6#/M15),KB$):PRINT
2160 PRINT"Jul ";:PRINT USING"$$######,.##";M7#;
2170 PRINT TAB(20);STRING$((M7#/M15),KB$)
2180 PRINT"Aug ";:PRINT USING"$$######,.##";M8#;
2190 PRINT TAB(20);STRING$((M8#/M15),KB$)
2200 PRINT"Sep ";:PRINT USING"$$######,.##";M9#;
2210 PRINT TAB(20);STRING$((M9#/M15),KB$):PRINT
2220 PRINT"Oct ";:PRINT USING"$$######,.##";M10#;
2230 PRINT TAB(20);STRING$((M10#/M15),KB$)
2240 PRINT"Nov ";:PRINT USING"$$######,.##";M11#;
2250 PRINT TAB(20);STRING$((M11#/M15),KB$)
2260 PRINT"Dec ";:PRINT USING"$$######,.##";M12#;
2270 PRINT TAB(20);STRING$((M12#/M15),KB$)
2280 PRINT:PRINT:PRINT" T O T A L ";USING"$$#######,.##";M14#
2290 PRINT:PRINT:CLOSE:GOSUB 4540:GOTO 1840
2300 PRINT:PRINT" There were no expenses for the selected category..."
2310 GOTO 2290
2320 LPRINT:LPRINT"Jan ";:LPRINT USING"$$######,.##";M1#;
2330 LPRINT TAB(20);STRING$((M1#/M15),KB$)
2340 LPRINT"Feb ";:LPRINT USING"$$######,.##";M2#;
2350 LPRINT TAB(20);STRING$((M2#/M15),KB$)
2360 LPRINT"Mar ";:LPRINT USING"$$######,.##";M3#;
2370 LPRINT TAB(20);STRING$((M3#/M15),KB$):LPRINT
2380 LPRINT"Apr ";:LPRINT USING"$$######,.##";M4#;
2390 LPRINT TAB(20);STRING$((M4#/M15),KB$)
2400 LPRINT"May ";:LPRINT USING"$$######,.##";M5#;
2410 LPRINT TAB(20);STRING$((M5#/M15),KB$)
2420 LPRINT"Jun ";:LPRINT USING"$$######,.##";M6#;
2430 LPRINT TAB(20);STRING$((M6#/M15),KB$):LPRINT
2440 LPRINT"Jul ";:LPRINT USING"$$######,.##";M7#;
2450 LPRINT TAB(20);STRING$((M7#/M15),KB$)
2460 LPRINT"Aug ";:LPRINT USING"$$######,.##";M8#;
2470 LPRINT TAB(20);STRING$((M8#/M15),KB$)
2480 LPRINT"Sep ";:LPRINT USING"$$######,.##";M9#;
2490 LPRINT TAB(20);STRING$((M9#/M15),KB$):LPRINT
2500 LPRINT"Oct ";:LPRINT USING"$$######,.##";M10#;
2510 LPRINT TAB(20);STRING$((M10#/M15),KB$)
2520 LPRINT"Nov ";:LPRINT USING"$$######,.##";M11#;
2530 LPRINT TAB(20);STRING$((M11#/M15),KB$)
2540 LPRINT"Dec ";:LPRINT USING"$$######,.##";M12#;
2550 LPRINT TAB(20);STRING$((M12#/M15),KB$)
2560 LPRINT:LPRINT" T O T A L ";USING"$$#######,.##";M14#
2570 LPRINT:LPRINT:CLOSE:GOTO 1840
2580 END
2590 ' READ A FILE AND ACCUMULATE TOTALS BY MONTH
2600 GET#1:IF A$="E" THEN RETURN
2610 IF A$="B" OR A$="M" THEN 2650
2620 IF A$="A" THEN 2630 ELSE RETURN
2630 GET#1:IF A$="E" THEN RETURN
2640 IF A$<>"B" AND A$<>"M" THEN 2630
2650 IF CVI(E$)<>KB% THEN 2630
2660 IF RIGHT$(B$,2)<>KB2$ THEN 2630
2670 A1$=LEFT$(B$,2)
2680 IF A1$="01" THEN M1#=M1#+CVD(C$):GOTO 2630
2690 IF A1$="02" THEN M2#=M2#+CVD(C$):GOTO 2630
2700 IF A1$="03" THEN M3#=M3#+CVD(C$):GOTO 2630
2710 IF A1$="04" THEN M4#=M4#+CVD(C$):GOTO 2630
2720 IF A1$="05" THEN M5#=M5#+CVD(C$):GOTO 2630
2730 IF A1$="06" THEN M6#=M6#+CVD(C$):GOTO 2630
2740 IF A1$="07" THEN M7#=M7#+CVD(C$):GOTO 2630
2750 IF A1$="08" THEN M8#=M8#+CVD(C$):GOTO 2630
2760 IF A1$="09" THEN M9#=M9#+CVD(C$):GOTO 2630
2770 IF A1$="10" THEN M10#=M10#+CVD(C$):GOTO 2630
2780 IF A1$="11" THEN M11#=M11#+CVD(C$):GOTO 2630
2790 M12#=M12#+CVD(C$):GOTO 2630
2800 ' DETERMINE WHICH NOMTH HAS HIGHEST COST
2810 M13=0:IF M1#>M13 THEN M13=M1#
2820 IF M2#>M13 THEN M13=M2#
2830 IF M3#>M13 THEN M13=M3#
2840 IF M4#>M13 THEN M13=M4#
2850 IF M5#>M13 THEN M13=M5#
2860 IF M6#>M13 THEN M13=M6#
2870 IF M7#>M13 THEN M13=M7#
2880 IF M8#>M13 THEN M13=M8#
2890 IF M9#>M13 THEN M13=M9#
2900 IF M10#>M13 THEN M13=M10#
2910 IF M11#>M13 THEN M13=M11#
2920 IF M12#>M13 THEN M13=M12#
2930 M14#=M1#+M2#+M3#+M4#+M5#+M6#+M7#+M8#+M9#+M10#+M11#+M12#:RETURN
2940 DATA 10,"Appliances.",22,"Entertainment."
2950 DATA 34,"Miscellaneous.",11,"Automobile Exp."
2960 DATA 23,"Food.",35,"Mortgage."
2970 DATA 12,"Capital Inv. (Auto)",24,"Furniture."
2980 DATA 36,"Paper/Magazines",13,"Capital Inv. (Bldgs)"
2990 DATA 25,"Gasoline/Oil (Auto).",37,"Supplies"
3000 DATA 14,"Capital Inv. (Other)",26,"Gas/Oil (Heating)."
3010 DATA 38,"Taxes.",15,"Cash Withdrawal."
3020 DATA 27,"Hobbies",39,"Telephone."
3030 DATA 16,"Clothing.",28,"Insurance."
3040 DATA 40,"Tools.",17,"Dental."
3050 DATA 29,"Interest.",41,"Tractor/Mower."
3060 DATA 18,"Donations (Church)",30,"Lawn/Garden."
3070 DATA 42,"Transfer to Invest.",19,"Donations (Other)."
3080 DATA 31,"Maint. (Bldgs).",43,"Transfer to Savings"
3090 DATA 20,"Education Exp.",32,"Maint. (Other)."
3100 DATA 44,"Vacation.",21,"Electricity."
3110 DATA 33,"Medical.",45,"Water / Sewer cost."
3120 DATA 0,"END"
3130 GOSUB 4520:GOSUB 4200:IF K1%=1 THEN 1590
3140 GOSUB 4310:IF K1%=1 THEN 1590
3150 GOSUB 4520:B%=2:PRINT"Reading Checking Account #1 files...":GOSUB 4560
3160 GOSUB 1050:GOSUB 3480:CLOSE:GOSUB 1010:GOSUB 3480:CLOSE
3170 PRINT"End of Checking Account #1 data.
3180 GOSUB 4540:IF K1%=1 THEN 1590
3190 GOSUB 4520:B%=2:PRINT"Reading Checking Account #2 files...":GOSUB 4560
3200 GOSUB 1060:GOSUB 3480:CLOSE:GOSUB 1020:GOSUB 3480:CLOSE
3210 PRINT"End of Checking Account #2 data.
3220 GOSUB 4540:IF K1%=1 THEN 1590
3230 GOSUB 4520:B%=2:PRINT"Reading Checking Account #3 files...":GOSUB 4560
3240 GOSUB 1070:GOSUB 3480:CLOSE:GOSUB 1030:GOSUB 3480:CLOSE
3250 PRINT"End of Checking Account #3 data.
3260 GOSUB 4540:IF K1%=1 THEN 1590
3270 GOSUB 4520:B%=2:PRINT"Reading Cash Expenditures file...":GOSUB 4560
3280 GOSUB 1000:GOSUB 3480:CLOSE
3290 PRINT"End of Cash Expenditures data.
3300 GOSUB 4540:GOTO 1590
3310 B%=6:P%=1:K9%=0:GOSUB 4520:GOSUB 4200:IF K1%=1 THEN 1590
3320 GOSUB 4310:IF K1%=1 THEN 1590
3330 KEY(9) ON:KEY(10) ON:SOUND 1200,.5
3340 PRINT:PRINT" Insure that the printer is ready.":GOSUB 4540
3350 IF K1%=1 THEN 1590 ELSE GOSUB 4520
3360 PRINT:PRINT" To temporarily stop the printer, press the F9 key.
3370 PRINT:PRINT" To STOP the printer and return to MENU, press the F1 key.
3380 LPRINT"TAX RELATED EXPENDITURES... From: " FD1$ " To: " FD2$;
3390 LPRINT TAB(70)"PAGE: " P%:LPRINT
3400 GOSUB 4600:LPRINT:LPRINT"CHECKING ACCOUNT #1."
3410 GOSUB 1050:GOSUB 3480:CLOSE:GOSUB 1010:GOSUB 3480:CLOSE
3420 B%=B%+2:LPRINT:LPRINT"CHECKING ACCOUNT #2."
3430 GOSUB 1060:GOSUB 3480:CLOSE:GOSUB 1020:GOSUB 3480:CLOSE
3440 B%=B%+2:LPRINT:LPRINT"CHECKING ACCOUNT #3."
3450 GOSUB 1070:GOSUB 3480:CLOSE:GOSUB 1030:GOSUB 3480:CLOSE
3460 B%=B%+2:LPRINT:LPRINT"CASH EXPENDITURES FILE."
3470 GOSUB 1000:GOSUB 3480:CLOSE:LPRINT CHR$(140):GOTO 1590
3480 GET#1:IF A$="B" THEN 3520 ELSE RETURN
3490 GET#1:IF A$="E" THEN RETURN
3500 IF K1%=1 THEN 1590
3510 IF A$="A" THEN 3490
3520 IF F$="N" OR F$="n" THEN 3490
3530 Y3$=RIGHT$(B$,2):D3$=LEFT$(B$,2)+MID$(B$,4,2)
3540 IF Y1$=Y2$ THEN 3580
3550 IF Y3$=Y1$ THEN 3630
3560 IF Y3$=Y2$ THEN 3640
3570 IF Y3$>Y1$ AND Y3$Y2$ THEN 3490
3590 IF D3$D2$ THEN 3490
3600 IF A%=0 THEN GOSUB 4420:GOTO 3490
3610 IF K9%=1 THEN 3650
3620 GOSUB 4460:GOTO 3490
3630 IF D3$=>D1$ THEN 3600 ELSE 3490
3640 IF D3$>D2$ THEN 3490 ELSE 3600
3650 LOCATE 24,5:PRINT"Printer stopped by F9 key. To continue, press F10 key.";
3660 GOTO 3610
3670 FOR C%=1 TO 36:Z#(C%)=0:NEXT
3680 CLOSE:GOSUB 4520:GOSUB 4200:IF K1%=1 THEN 1590
3690 GOSUB 4310:IF K1%=1 THEN 1590
3700 GOSUB 4520:PRINT" Reading Checking Account #1 files...
3710 GOSUB 1010:GOSUB 3840:CLOSE:GOSUB 1050:GOSUB 3840:CLOSE
3720 PRINT" Reading Checking Account #2 files...
3730 GOSUB 1020:GOSUB 3840:CLOSE:GOSUB 1060:GOSUB 3840:CLOSE
3740 PRINT" Reading Checking Account #3 files...
3750 GOSUB 1030:GOSUB 3840:CLOSE:GOSUB 1070:GOSUB 3840:CLOSE
3760 PRINT" Reading Cash Expenditures file...
3770 GOSUB 1000:GOSUB 3840:CLOSE:IF B%=1 THEN 3790
3780 GOSUB 3990:GOSUB 4540:GOTO 1590
3790 PRINT:BEEP:PRINT" Insure that the printer is ready...":GOSUB 4540
3800 IF K1%=1 THEN 1590 ELSE GOSUB 4520
3810 PRINT" Now printing requested data..."
3820 GOSUB 4110:GOTO 1590
3830 ' GET A RECORD and ADD AMOUNT TO ARRAY.
3840 GET#1:IF A$="B" OR A$="M" THEN 3880 ELSE RETURN
3850 GET#1:IF A$="E" THEN RETURN
3860 IF K1%=1 THEN 1590
3870 IF A$="A" THEN 3850
3880 Y3$=RIGHT$(B$,2):D3$=LEFT$(B$,2)+MID$(B$,4,2)
3890 IF Y1$=Y2$ THEN 3930
3900 IF Y3$=Y1$ THEN 3970
3910 IF Y3$=Y2$ THEN 3980
3920 IF Y3$>Y1$ AND Y3$Y2$ THEN 3850
3940 IF D3$D2$ THEN 3850
3950 C%=(CVI(E$)-9):IF C%<1 OR C%>36 THEN 3850
3960 Z#(C%)=Z#(C%)+CVD(C$):GOTO 3850
3970 IF D3$=>D1$ THEN 3950 ELSE 3850
3980 IF D3$>D2$ THEN 3850 ELSE 3950
3990 GOSUB 4100:RESTORE:FOR C%=10 TO 30
4000 READ A%,KB$:IF A%=0 THEN RESTORE
4010 IF A%<>C% THEN 4000
4020 PRINT TAB(5) A% " - " KB$ TAB(36) USING"$$######,.##";Z#(C%-9):NEXT
4030 GOSUB 4540:RESTORE:GOSUB 4100:FOR C%=31 TO 45
4040 READ A%,KB$:IF A%=0 THEN RESTORE
4050 IF A%<>C% THEN 4040
4060 PRINT TAB(5) A% " - " KB$ TAB(36) USING"$$######,.##";Z#(C%-9):NEXT
4070 A#=0:FOR C%=1 TO 36:A#=A#+Z#(C%):NEXT
4080 A#=A#-Z#(6)
4090 PRINT:PRINT TAB(13) "GRAND TOTAL:" TAB(35) USING"$$#######,.##";A#:RETURN
4100 GOSUB 4520:PRINT"E X P E N S E T O T A L S FROM: " FD1$ " TO: " FD2$:PRINT:RETURN
4110 GOSUB 4190:RESTORE:FOR C%=10 TO 45
4120 READ A%,KB$:IF A%=0 THEN RESTORE
4130 IF A%<>C% THEN 4120
4140 LPRINT TAB(5) A% " - " KB$ TAB(36) USING"$$######,.##";Z#(C%-9):NEXT
4150 A#=0:FOR C%=1 TO 36:A#=A#+Z#(C%):NEXT
4160 A#=A#-Z#(6)
4170 LPRINT:LPRINT TAB(13) "GRAND TOTAL:" TAB(35) USING"$$#######,.##";A#
4180 LPRINT CHR$(140):RETURN
4190 LPRINT:LPRINT"E X P E N S E T O T A L S FROM: " FD1$ " TO: " FD2$:LPRINT STRING$(80,163):LPRINT:RETURN
4200 PRINT
4210 PRINT" Enter starting date (0,4, or 6 digits in MMDDYY format): ";
4220 X%=POS(0):Y%=CSRLIN:INPUT"",KB$
4230 IF LEN(KB$)=6 THEN 4290
4240 IF LEN(KB$)=4 THEN 4280
4250 IF LEN(KB$)=0 THEN 4270
4260 BEEP:GOTO 4210
4270 FD1$=LEFT$(DATE$,2)+"-"+MID$(DATE$,4,2)+"-"+RIGHT$(DATE$,2):Y1$=RIGHT$(FD1$,2):D1$=LEFT$(FD1$,2)+MID$(FD1$,4,2):GOTO 4300
4280 FD1$=LEFT$(KB$,2)+"-"+MID$(KB$,3,2)+"-"+RIGHT$(DATE$,2):Y1$=RIGHT$(FD1$,2):D1$=KB$:GOTO 4300
4290 FD1$=LEFT$(KB$,2)+"-"+MID$(KB$,3,2)+"-"+RIGHT$(KB$,2):Y1$=RIGHT$(KB$,2):D1$=LEFT$(KB$,4)
4300 LOCATE Y%,X%:PRINT FD1$:RETURN
4310 PRINT
4320 PRINT" Enter ending date (0,4, or 6 digits in MMDDYY format): ";
4330 X%=POS(0):Y%=CSRLIN:INPUT"",KB$
4340 IF LEN(KB$)=6 THEN 4400
4350 IF LEN(KB$)=4 THEN 4390
4360 IF LEN(KB$)=0 THEN 4380
4370 BEEP:GOTO 4320
4380 FD2$=LEFT$(DATE$,2)+"-"+MID$(DATE$,4,2)+"-"+RIGHT$(DATE$,2):Y2$=RIGHT$(FD2$,2):D2$=LEFT$(FD2$,2)+MID$(FD2$,4,2):GOTO 4410
4390 FD2$=LEFT$(KB$,2)+"-"+MID$(KB$,3,2)+"-"+RIGHT$(DATE$,2):Y2$=RIGHT$(FD2$,2):D2$=KB$:GOTO 4410
4400 FD2$=LEFT$(KB$,2)+"-"+MID$(KB$,3,2)+"-"+RIGHT$(KB$,2):Y2$=RIGHT$(KB$,2):D2$=LEFT$(KB$,4)
4410 LOCATE Y%,X%:PRINT FD2$:RETURN
4420 PRINT CVI(D$) TAB(10) B$ TAB(20) USING"$$######,.##";CVD(C$);
4430 PRINT TAB(34) CVI(E$) TAB(40) F$ TAB(44) G$;:B%=B%+1
4440 IF B%<21 THEN RETURN
4450 B%=0:GOSUB 4540:GOSUB 4520:GOSUB 4560:RETURN
4460 LPRINT CVI(D$) TAB(10) B$ TAB(20) USING"$$######,.##";CVD(C$);
4470 LPRINT TAB(34) CVI(E$) TAB(40) F$ TAB(44) LEFT$(G$,36):B%=B%+1
4480 IF B%<62 THEN RETURN
4490 P%=P%+1:LPRINT CHR$(140):LPRINT"TAX RELATED EXPENDITURES... From: ";
4500 LPRINT FD1$ " To: " FD2$ TAB(70)"Page: " P%:LPRINT:B%=4
4510 GOSUB 4600:RETURN
4520 CLS:FDATE$=LEFT$(DATE$,2)+"-"+MID$(DATE$,4,2)+"-"+RIGHT$(DATE$,2)
4530 LOCATE 25,72:PRINT FDATE$;:LOCATE 1,1:RETURN
4540 LOCATE 25,25:COLOR 18:PRINT"Press any key to continue...";:COLOR 7
4550 KB$=INKEY$:IF KB$="" THEN 4550 ELSE RETURN
4560 PRINT" ITEM# DATE AMOUNT CODE TAX";
4570 PRINT" D E S C R I P T I O N"
4580 PRINT" "+STRING$(5,45)+" "+STRING$(8,45)+" "+STRING$(11,45);
4590 PRINT" "+STRING$(2,45)+" "+CHR$(45)+" "+STRING$(37,45);:RETURN
4600 LPRINT" ITEM# DATE AMOUNT CODE TAX";
4610 LPRINT" D E S C R I P T I O N"
4620 LPRINT" "+STRING$(5,45)+" "+STRING$(8,45)+" "+STRING$(11,45);
4630 LPRINT" "+STRING$(2,45)+" "+CHR$(45)+" "+STRING$(37,45);:RETURN
4640 K9%=1:RETURN
4650 K9%=0:LOCATE 24,1:PRINT TAB(70);:RETURN
4660 LOCATE 1,1:RESTORE
4670 READ A%,KB$:IF A%=0 THEN RETURN
4680 PRINT A% "- " KB$;:READ A%,KB$:IF A%=0 THEN RETURN
4690 PRINT TAB(28) A% "- " KB$;:READ A%,KB$:IF A%=0 THEN RETURN
4700 PRINT TAB(54) A% "- " KB$:GOTO 4670
4710 IF ERR=24 THEN RESUME
4720 IF ERR=6 THEN PRINT"Number too large... re-enter: ":RESUME
4730 ON ERROR GOTO 0:RESUME