home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Spring / rerun-1985-spring.d64 / records (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  10KB  |  304 lines

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