home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1985 Spring
/
rerun-1985-spring.d64
/
records
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
10KB
|
304 lines
1 rem tax records 64
2 rem poke788,52:rem disable stop/run **
6 open15,8,15:u$=chr$(145):rt$=chr$(18):ro$=chr$(146):vp=1
10 poke53281,1:poke53280,1:printchr$(144)chr$(147)
12 sl=54272:sh=54273:pl=54274:ph=54275:sw=54276:sa=54277:ss=54278:sv=54296
15 goto300
16 forx=1to39:printchr$(32);:nextx:printu$:return
20 gosub25:gosub26:gosub27:return
21 forx=1to500:nextx:return
22 printrt$" <return> to continue":ip$="":gosub100:print:inputa$:return
24 printrt$"initializing disk":print#15,"i0":return
25 printchr$(147):print:print:return
26 input#15,x6$,x7$:printrt$"disk status ";x6$;" ";x7$:return
27 forx=0to39:printchr$(102);:nextx:ip$="":gosub100:printu$;:return
30 printrt$"memory available:";fre(0)-(fre(0)<0)*65536:return
35 v3=len(am$(c)):h3=12-v3:v5=37-v3:ifh3<1thenh3=1
36 printca$(c);" ";sc$(c);" ";so$(c);tab(14)da$(c);:printtab(22)re$(c);
37 printtab(29)"$";tab(v5)am$(c):am=val(am$(c)):lc=lc+1:ifza=1thenlc=0
38 ifca$(c)="i"thent1=am+t1
39 ifca$(c)="d"thent2=am+t2
40 ifp$="y"thenv1=len(so$(c)):v2=len(re$(c)):h1=12-v1:h2=12-v2
41 ifp$="y"thenprint#2,ca$(c);"..";sc$(c);"..";so$(c);spc(h1)da$(c);
42 ifp$="y"thenprint#2,"";spc(4)re$(c);spc(h2);"$";spc(h3)am$(c)
43 iflc>12thenlc=0:gosub22
45 return
46 ifp$="y"thenprint#2:print#2,"total income $";t1
47 ifp$="y"thenprint#2,"total deductions $";t2
49 return
50 print"category (i) or (d)":ip$="":gosub100
51 inputca$:ifca$="i"then53
52 ifca$<>"d"thenprintu$;:goto51
53 print"source (minimum 4 letters)":inputso$
54 e=0:forc=1ton
55 ifca$<>ca$(c)orleft$(so$,4)<>left$(so$(c),4)then60
56 gosub35
57 printrt$" correct data (y/n) ":ip$="":gosub100:inputx$
58 ifx$="y"then62
59 printu$u$u$u$:gosub16
60 nextc
61 ip$="record not found":gosub100:print:e=1:gosub21
62 return
70 close2:input"will you need a print out (y/n)";p$:ifp$="y"thenopen2,4
71 ifp$="y"thenprint#2,"file: ";n$:print#2:print#2,"search:";a$;" 1=category ";
72 ifp$="y"thenprint#2,"2=sub cat 3=source 4=month 5=record 6=amount":print#2
73 ifp$="y"thenprint#2,"c sub source......date.....";
74 ifp$="y"thenprint#2,"record...........amount":print#2
75 return
76 j=0:ifb$="i"andca$(c)=b$thenj=1:return
77 ifb$="d"andca$(c)=b$thenj=1:return
78 ifb$="b"thenj=1:return
79 return
80 gosub27:printrt$"i"ro$"ncome":print"or":printrt$"d"ro$"eduction"
82 print
84 inputb$
86 ifb$="i"thenreturn
87 ifb$="d"thenreturn
89 ifb$<>"d"thenprintu$;:goto84
90 print"finished":ip$="":gosub100:print
91 gosub46
92 printrt$"total income $"t1:printrt$"total deductions $"t2
96 ifvp>0then close2
98 gosub22:return
100 forxc=0tolen(ip$)
102 pokesv,8:pokesh,50:pokesl,60:pokesa,120:pokess,30:pokesw,17
104 printleft$(ip$,xc+1)u$:forx=1to78:nextx:pokesv,0:pokesw,16:nextxc
108 forx=54272to54296:pokex,0:nextx:forx=1to100:nextx:return
200 print:ip$="are you sure (y/n)":gosub100:print:return
300 gosub25:gosub27:print:ip$="tax records 64":gosub100:print:gosub27
310 print"by g.fields":print:print:print"* 1984 *"
340 dimca$(500),sc$(500),so$(500),da$(500),re$(500),am$(500):gosub21
500 gosub20:lc=0
510 printrt$" file options ":print
530 printtab(6)rt$"n"ro$"ew file - create"
531 printtab(6)rt$"l"ro$"oad existing file"
532 printtab(6)rt$"a"ro$"dd to file"
534 printtab(6)rt$"d"ro$"elete from file"
536 printtab(6)rt$"c"ro$"hange data"
538 printtab(6)rt$"m"ro$"erge two files"
539 printtab(6)rt$"r"ro$"esave file"
540 printtab(6)rt$"s"ro$"tatus check"
541 printtab(6)rt$"i"ro$"nitialize disk"
542 printtab(6)rt$"?"ro$" memory available":print
543 printtab(6)rt$"h"ro$"elp !"
544 printtab(6)rt$"f1"ro$" work with or print file"
545 printtab(6)rt$"f2"ro$" scratch a file":gosub27
550 printrt$" select by letter "
570 geta$:ifa$=""then570
571 ifa$="s"thengosub26
572 ifa$="?"thengosub30
573 ifa$="i"thengosub24:gosub16
574 ifa$="n"thenza=0:gz=0:goto7000
575 ifa$=chr$(137)then1700
576 ifa$="l"thenza=1:gz=0:goto5500
577 ifa$="h"thenh=1:goto2000
578 ifza<>1thenip$="no file in memory":gosub100:gosub16:goto570
580 ifa$="a"then7200
582 ifa$="d"then7400
584 ifa$="c"then7600
585 ifa$="m"then7800
586 ifa$="r"then610
590 ifa$<>chr$(133)then570
600 ifwf<>1then700
610 gosub20:printrt$"before continuing: ":print
620 print"save the file now in memory"
630 print"using a date as a file name"
640 print"is good practice."
645 print"name file":ip$="":gosub100:print
646 n$="":inputn$:iflen(n$)<1orlen(n$)>16thenprintu$;:goto646
650 open1,8,2,"@0:"+n$+",s,w"
655 gosub26:ifx7$<>"ok"thenclose1:goto645
660 forc=1ton
665 print#1,ca$(c):print#1,sc$(c):print#1,so$(c):print#1,da$(c)
667 print#1,re$(c):print#1,am$(c):nextc
680 close1:gosub26:print" file "n$" saved":print:gosub22
700 gosub20:za=0:t1=0:t2=0:p$="n":lc=0:wf=0
710 printrt$"work with file ";n$
720 printtab(6)rt$"t"ro$"otal review"
721 printrt$" search for (by #) "
722 printtab(6)rt$"1"ro$"category"
724 printtab(6)rt$"2"ro$"subcategory"
726 printtab(6)rt$"3"ro$"source"
728 printtab(6)rt$"4"ro$"month"
730 printtab(6)rt$"5"ro$"record"
732 printtab(6)rt$"6"ro$"amount":print
734 printtab(6)rt$"q"ro$"uit and close all files"
736 printtab(6)rt$"h"ro$"elp !"
738 printtab(6)rt$"s"ro$"tatus of disk"
740 printtab(6)rt$"?"ro$"memory available"
742 printtab(6)rt$"i"ro$"nitialize disk"
744 printtab(6)rt$"f1"ro$" return to file options"
800 gosub27:printrt$" select by letter "
810 geta$:ifa$=""then810
818 ifa$="t"then900
820 ifa$="1"then950
822 ifa$="2"then1000
824 ifa$="3"then1100
826 ifa$="4"then1200
828 ifa$="5"then1300
830 ifa$="6"then1400
832 ifa$="q"then1500
834 ifa$="h"thenh=0:goto2000
836 ifa$="s"thengosub26
838 ifa$="?"thengosub30
840 ifa$="i"thengosub24
842 ifa$=chr$(133)thenza=1:goto500
850 goto810
900 gosub20:vp=0
910 printrt$" total review ":print:gosub70:goto916
912 printgg$:t1=0:t2=0:lc=0:ifp$="y"thenprint#2:print#2,gg$:print#2
914 forc=1ton:ifca$(c)=gh$andsc$(c)=left$(gg$,1)thengosub35
915 nextc:gosub90:return
916 gh$="i":gg$="wages":gosub912:gg$="farm":gosub912:gg$="dividends":gosub912
918 gg$="interest":gosub912:gg$="rental":gosub912:gg$="business":gosub912
920 gg$="other":gosub912
926 gh$="d"
928 gg$="interest":gosub912:gg$="medical":gosub912:gg$="educational":gosub912
930 gg$="tax":gosub912:gg$="contribution":gosub912
932 gg$="retirement fund":gosub912:gg$="business":gosub912:gg$="other":gosub912
948 goto700
950 gosub20:printrt$" category search (i) or (d) ":gosub70
955 input"category";wc$:forc=1ton:ifca$(c)=wc$thengosub35
960 nextc:gosub90:vp=1:goto700
1000 gosub20:printrt$" sub category search ":gosub70:gosub80
1002 printrt$" income= w f d i r b o":printrt$"deduction= i m e t c r b o"
1004 input"sub category";wc$:forc=1ton:gosub76
1005 ifca$(c)=b$andsc$(c)=wc$thengosub35
1006 nextc:gosub90:goto700
1100 gosub20:printrt$" source search (first 4 letters) ":gosub70:gosub80
1102 input"source";wc$:forc=1ton:gosub76
1103 ifca$(c)=b$andleft$(so$(c),4)=left$(wc$,4)thengosub35
1104 nextc:gosub90:goto700
1200 gosub20:printrt$" month search (2 letters) ":gosub70:gosub80
1202 input"month";wc$:iflen(wc$)<>2thenprintu$;:goto1202
1204 forc=1ton:gosub76:ifca$(c)=b$andleft$(da$(c),2)=wc$thengosub35
1206 nextc:gosub90:goto700
1300 gosub20:printrt$" record/receipt search (max 6 letters) ":gosub70:gosub80
1302 input"record/receipt";wc$:iflen(wc$)<1orlen(wc$)>6thenprintu$;:goto1302
1304 forc=1ton:gosub76:ifca$(c)=b$andre$(c)=wc$thengosub35
1306 nextc:gosub90:goto700
1400 gosub20:printrt$" amount search ":gosub70:gosub80
1402 input"amount (no $)";wc$:forc=1ton:gosub76
1403 ifca$(c)=b$andam$(c)=wc$thengosub35
1404 nextc:gosub90:goto700
1500 gosub20:printrt$" exit & close all files ":print:print
1502 gosub200:print:inputa$:ifa$<>"y"then700
1504 poke788,49:close1:close2:close15:end
1700 gosub20:printrt$" scratch a file ":gosub27
1702 gosub200:inputa$:ifa$<>"y"then500
1704 gosub27:print"name file to scratch":inputnn$:gosub200
1705 inputa$:ifa$<>"y"then500
1706 gosub24:print#15,"s0:"+nn$
1708 gosub26:printrt$;nn$;" scratched":gosub22:goto500
2000 printchr$(147)
2010 printrt$" help ! ":print
2020 printrt$" categories two "
2025 pri