Compucolor.org – Virtual Media

Listing of file='CHKBK.BAS;01' on disk='vmedia/chip_57-sector.ccvf'

10 CLEAR 200:T= 30:REM T=30 USED FOR TAB POSITION
20 DIM N$(26),M$(12)
30 FOR I= 1TO 12:READ M$(I):NEXT I:REM READS MONTHS FOR FILE
40 T1= 40
50 T2= 54
60 Z$= ""
70 REM             NOT E STATMENT   80  SHOULD SHOW
72 REM              THE LAST TWO NUMBERS OF YOUR CHECKBOOK YEAR
80 Y= 19:YR$= "82"
100 PLOT 12,15:PRINT TAB( 20)"CHECKBOOK PROGRAM"
102 PRINT :PRINT :PRINT TAB( 27)Y;YR$
104 PRINT :PRINT "      TO CHANGE YEAR CHANGE NUMBER  80 "
110 PLOT 3,0,10:PRINT "ENTER FUNCTION AND TYPE RETURN :":PRINT
120 PRINT " 1 - INPUT NEW ENTRY"
130 PRINT " 2 - UPDATE ENTRY"
140 PRINT " 3 - LIST MONTHLY TRANSACTIONS"
150 PRINT " 4 - LIST YTD TOTAL FOR ALL"
160 PRINT " 5 - LIST YTD TOTAL FOR ACCOUNT"
170 PRINT " 6 - EXIT PROGRAM"
200 PRINT :PRINT
210 INPUT "FUNCTION ?";C
220 IF C< 1OR C> 6THEN 210
222 PRINT
230 ON CGOTO 1000,2000,3000,4000,5000,6000
260 GOTO 100
400 REM  OPEN DATA FILE
401 FILE "T",8000
410 GOSUB 800
420 FILE "R",1,F$+ ";1",2
430 RR= 1:GOSUB 500:NR= CN
440 RETURN
500 REM  READ A RECORD
510 GET 1,RR;D$[6],CN,AN,N$[26],AM$[8]
520 RETURN
600 REM  WRITE A RECORD
602 IF LEN (AM$)= 8THEN 610
604 FOR I= 1TO 8- LEN (AM$)
606 AM$= " "+ AM$:NEXT I
610 PUT 1,RR;D$[6],CN,AN,N$[26],AM$[8]
620 RETURN
700 REM  LIST ENTRY BY LINE
702 IF AN< 1000THEN PRINT Z$;:GOTO 710
704 PRINT "";
710 PRINT LEFT$ (D$,2)"/"MID$ (D$,3,2)"/"RIGHT$ (D$,2);
720 PRINT ""CN;TAB( 12)AN TAB( 18)N$;
730 PRINT  TAB( 45)LEFT$ (AM$,6)+ "."+ RIGHT$ (AM$,2);TAB( 54);
740 RETURN
800 PRINT :REM  GET FILE NAME
810 INPUT "WHAT MONTH (1-12) ?";S
812 IF S< 1OR S> 12THEN 800
820 F$= M$(S)
850 F$= F$+ YR$+ ".CKB":REM F$ NOW=MONTH &LAST 2 NOS OF YEAR
860 RETURN
900 REM   DISPLAY HEADER
902 PLOT 12:PRINT :PRINT
910 PRINT "  DATE   CK  ACCOUNT  NAME","      FOR ";
920 PRINT "     AMOUNT","BALANCE"
930 PRINT "--------------------------------------------------";
940 PRINT "-------------"
950 PRINT ""
960 RETURN
1000 REM  INPUT NEW ENTRY
1010 FILE "T",30400
1020 GOSUB 800
1030 FILE "R",1,F$+ ";1",2
1040 GOSUB 430:GOTO 1120
1050 FILE "R",1,F$+ ";1",2
1070 INPUT "BALANCE FORWARD ?";B
1080 B= B* 100:AM$= STR$ (B):CN= 0:AN= 0
1082 D$= STR$ (S):IF ASC (LEFT$ (D$,1))< > 32THEN 1084
1083 D$= "0"+ RIGHT$ (D$,1)
1084 D$= D$+ "01"+ C$:N$= "BALANCE FORWARD"
1085 RR= 2:GOSUB 600:RR= RR+ 1
1086 GOTO 1200
1120 RR= NR+ 1
1200 PLOT 12:GOSUB 30000
1212 B$= D$
1220 INPUT "MONTH & DAY (MMDD) OR E( ENTER INTO FILE) ?";D$:IF  D$= "E"THEN  7000
1221 D$= D$+ YR$
1223 IF D$= "0"THEN D$= B$:GOTO 1226
1225 IF LEN (D$)< > 6THEN 1220
1226 INPUT "CHECK OR DEPOSIT NUMBER ?";CN
1227 INPUT "ACCOUNT NUMBER ?";AN:PRINT "                         ,                        ,"
1228 INPUT "PAYER OR PAYEE & COMMENT?";N$
1240 INPUT "AMOUNT ($$$$.CC) ?";AM$:REM  A STRING 7 BYTES
1250 IF LEN (AM$)> 8THEN 1240
1260 N$= LEFT$ (N$,26)
1270 IF CN> 9999OR AN> 9999THEN 1200
1272 B= VAL (AM$):B= B* 100:AM$= STR$ (B)
1280 GOSUB 600:RR= RR+ 1
1290 PRINT :GOTO 1200
2000 REM  -------------- UPDATE ENTRY
2010 PRINT "DO YOU KNOW  CK.DATE , CK OR DEP.NO. , ACC. NO."
2020 GOSUB 400:PRINT
2030 INPUT "WHAT DATE MONTH & DAY(MMDD) ?";C$:C$= C$+ YR$
2032 IF LEN (C$)< 5OR LEN (C$)> 6THEN 2030
2040 INPUT "WHAT CHECK OR DEPOSIT NO. ?";C1
2042 IF C1> 9999THEN 2040
2044 PLOT 12:GOSUB 30000
2050 INPUT "WHAT ACCOUNT NO. ?";A1
2052 IF A1> 9999THEN 2050
2060 RR= RR+ 1:IF RR> NRTHEN 2500
2080 GOSUB 500
2090 IF D$< > C$THEN 2060
2100 IF CN< > C1THEN 2060
2110 IF AN< > A1THEN 2060
2112 PRINT :GOSUB 700:PRINT :PRINT
2114 INPUT "MONTH & DAY (MMDD) ?";B$:B$= B$+ YR$
2116 IF B$= "0"THEN 2120
2118 D$= B$:IF LEN (D$)< > 6THEN 2114
2120 INPUT "CHECK OR DEPOSIT NO. ?";CN:REM AT TIMES CHECK NO.IS CN,RR OR NR
2130 INPUT "ACCOUNT NO. ?";AN
2135 PRINT "                         ,                         ,"
2140 INPUT "PAYER OR PAYEE & COMMENT?";N$
2150 INPUT "AMOUNT ?";AM$
2160 N$= LEFT$ (N$,26)
2170 IF LEN (AM$)> 8THEN 2150
2200 B= VAL (AM$):B= B* 100:AM$= STR$ (B):GOSUB 600
2210 RR= NR+ 1:GOTO 7000
2500 PRINT :PRINT :PRINT "RECORD NOT FOUND"
2510 GOTO 7000
3000 REM   -----------------LIST MONTHLY TRANSACTIONS
3010 GOSUB 400:GOSUB 900
3020 B= 0
3050 RR= RR+ 1:IF RR> NRTHEN 3100
3060 GOSUB 500:GOSUB 700
3070 IF AN< 1000THEN B= B+ VAL (AM$):GOTO 3090
3084 B= B- VAL (AM$)
3090 GOSUB 20000:GOTO 3050
3100 FILE "C",1:GOTO 10000
4000 REM   ----------------- LIST YEARLY TRANSACTIONS -------
4022 GOSUB 900
4030 FILE "T",8000
4040 B= 0:L= 1
4100 FOR L= LTO 12
4110 F$= M$(L)+ YR$+ ".CKB;1"
4120 FILE "R",1,F$,2
4130 RR= 1:GOSUB 500:NR= CN
4140 RR= RR+ 1:IF RR> NRTHEN 4150
4142 GOSUB 500:GOSUB 700
4143 IF L= 1AND AN= 0THEN 4145
4144 IF AN= 0THEN 4148
4145 IF AN< 1000THEN B= B+ VAL (AM$):GOTO 4148
4146 B= B- VAL (AM$)
4148 GOSUB 20000:GOTO 4140
4150 FILE "C",1:PRINT :NEXT L
4160 GOTO 10000
5000 REM  ------------LIST ACCOUNT TRANSACTIONS -------------
5030 GOSUB 30000
5040 INPUT "ACCOUNT NUMBER ?";N1
5050 IF N1< 0OR N1> 9999THEN 5040
5052 GOSUB 900
5060 FILE "T",8200
5070 B= 0:L= 1
5080 FOR L= LTO 12
5090 F$= M$(L)+ YR$+ ".CKB;1"
5100 FILE "R",1,F$,2
5110 RR= 1:GOSUB 500:NR= CN
5120 RR= RR+ 1:IF RR> NRTHEN 5300
5130 GOSUB 500:IF AN< > N1THEN 5120
5140 GOSUB 700:B= B+ VAL (AM$)
5150 GOSUB 20000
5200 GOTO 5120
5300 FILE "C",1:PRINT :NEXT L:GOTO 10000
6000 REM  --------------------- EXIT PROGRAM ---------------
6010 LOAD "MENU":RUN
7000 REM  CLEAN UP FILES
7010 CN= RR- 1:RR= 1:GOSUB 600
7020 FILE "C",1
7060 GOTO 100
8000 REM  FILE ERROR TRAPS
8010 FILE "E",F1,E1,LN
8020 IF LN< > 4120THEN 8100
8030 IF L= 12THEN 10000
8040 L= L+ 1:GOTO 4100
8100 PRINT :PRINT :PRINT :PRINT "EMPTY MONTH":GOSUB 10000
8110 GOTO 100
8200 FILE "E",F1,E1,LN
8210 IF LN< > 5100THEN 8100
8220 IF L= 12THEN 10000
8230 L= L+ 1:GOTO 5080
9000 DATA JAN,FEB,MAR,APR,MAY,JUN
9100 DATA JUL,AUG,SEP,OCT,NOV,DEC
10000 REM  WAIT FOR INPUT
10010 PLOT 3,18,30
10020 INPUT "HIT RETURN TO CONTINUE";C$
10030 GOTO 100
20000 REM  ------------ UPDATE BALANCE
20010 C$= STR$ (B):IF LEN (C$)= 8THEN 20050
20020 FOR I= 1TO 8- LEN (C$):C$= " "+ C$:NEXT I
20050 PRINT LEFT$ (C$,6)+ "."+ RIGHT$ (C$,2)
20060 RETURN
30000 REM     LIST ACCOUNT NUMBERS
30020 PRINT :PRINT
30040 PRINT "     DEPOSITS"TAB( T)"  WITHDRAWALS"
30060 PRINT :PRINT " 100 - WAGES"TAB( T)"1000 - UTILITIES"
30080 PRINT " 200 - INTEREST"TAB( T)"1500 - AUTO & TRAILERS"
30100 PRINT " 300 - DIVIDEND"TAB( T)"2000 - CASH"
30120 PRINT " 400 - FUND TRANS."TAB( T)"2500 - CONTRIBUTIONS"
30160 PRINT " 500 - OTHER"TAB( T)"3000 - MEDICAL"
30170 PRINT " 600--  -DUMMY DEPOSIT"  TAB( T)"3500 - TAXES INCOME "
30180 PRINT TAB( T)"4000 - TAXES REAL ESTATE"
30200 PRINT TAB( T)"4500 - TAX EXEMPT"
30220 PRINT TAB( T)"5000 - INSURANCE"
30240 PRINT TAB( T)"5500 - HOME MAINTANCE"
30260 PRINT TAB( T)"6000 - COTTAGE ACCOUNTS"
30280 PRINT TAB( T)"6500 - OTHER"
30300 PRINT TAB( T)"7000 -   CONSULTING"
30320 PRINT TAB( T)"7500 -   CONSULTING/AUTO"
30340 PRINT TAB( T)"8000 -   TOOLS & SUPPLIES "
30360 PRINT TAB( T)"8500 -   DUES & SUBSCRIPTIONS"
30370 PRINT TAB( T)"9000----   -DUMMY CHECK"
30380 PRINT :RETURN
30400 REM    CREATE NEW MONTH
30420 FILE "N",F$+ ";1",40,48,20
30440 RR= 2:GOTO 1050