home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Spring / rerun-1985-spring.d64 / records (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  9.4 KB  |  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 print"i ncome","d eduction"
  197. 2030 printrt$" sub category *income   "
  198. 2040 print"w ages","f arm","d ividend","o ther"
  199. 2045 print"i nterest","r ental","b usiness"
  200. 2050 printrt$" sub category *deduction"
  201. 2060 print"i nterest","m edical","e ducation"
  202. 2065 print"b usiness","t ax","c ontribution"
  203. 2067 print"o ther",,"r etirement fund"
  204. 2100 printrt$" source                 "
  205. 2110 print"minimum 4 letters - maximum 10 letters"
  206. 2120 printrt$"date  (month-day)       "
  207. 2125 print"example:04-28  (5 letters)"
  208. 2130 printrt$" record/receipt         "
  209. 2140 print"example:ck#123 (max 6 letters)"
  210. 2150 printrt$" amount                 "
  211. 2160 print"no'$' (dollar sign)"
  212. 2180 print:gosub22
  213. 2200 ifh=1then500
  214. 2210 ifh<>1then700
  215. 5500 gosub20
  216. 5510 print"recall file":print
  217. 5515 print:input"name file to recall";n$
  218. 5520 iflen(n$)<1orlen(n$)>16thenprintu$:goto5515
  219. 5524 open1,8,2,"0:"+n$+",s,r":c=0:gosub26
  220. 5525 ifx6$="62"thenclose1:za=0:goto5536
  221. 5526 c=0
  222. 5527 c=c+1
  223. 5529 input#1,ca$(c),sc$(c),so$(c),da$(c),re$(c),am$(c):s=st
  224. 5530 gosub35
  225. 5532 ifs=0goto5527
  226. 5534 n=c:close1:print"total count: "n" records":ip$="  ":gosub100:print
  227. 5536 gosub22:goto500
  228. 7000 gosub20:printrt$" create a new file                      "
  229. 7010 ip$="name new file":gosub100:print:inputn$
  230. 7020 open1,8,2,"@0:"+n$+",s,w"
  231. 7025 gosub21:gosub20:ifx7$<>"ok"then7010
  232. 7030 printrt$"category: "r0$spc(2)rt$" ! "ro$" close file"
  233. 7035 print:printrt$"cat  sub/cat  source  date  rec   amount"
  234. 7040 input"category (i) (d) (!)";ca$
  235. 7042 ifca$="i"then7045
  236. 7043 ifca$="!"thenclose1:gosub20:print:ip$="file closed":gosub100:goto500
  237. 7044 ifca$<>"d"thenprintu$;:goto7040
  238. 7045 input"sub category";sc$
  239. 7046 ifca$="d"then7056
  240. 7048 ifsc$="w"orsc$="f"orsc$="d"orsc$="i"orsc$="r"then7060
  241. 7052 ifsc$="b"orsc$="o"then7060
  242. 7054 printu$;:goto7045
  243. 7056 ifsc$="i"orsc$="m"orsc$="e"orsc$="t"orsc$="c"then7060
  244. 7058 ifca$="d"andsc$="r"orsc$="b"orsc$="o"then7060
  245. 7059 printu$;:goto7045
  246. 7060 input"source (min/4 max/10)";so$
  247. 7062 iflen(so$)<4orlen(so$)>10thenprintu$;:goto7060
  248. 7065 print"date - month-day -"
  249. 7066 printrt$"example->    04-29"ro$;:inputda$
  250. 7067 iflen(da$)<>5thenprintu$;:goto7066
  251. 7070 print"record/receipt (max 6 letters)"
  252. 7071 printrt$"example->  ck#134"ro$;:inputre$
  253. 7072 iflen(re$)<1orlen(re$)>6thenprintu$;:goto7071
  254. 7075 input"amount (no $ symbols)";am$
  255. 7076 ifleft$(am$,1)<chr$(46)orleft$(am$,1)>chr$(57)thenprintu$;:goto7075
  256. 7077 ifleft$(right$(am$,3),1)<>chr$(46)thenprintu$;:goto7075
  257. 7078 ip$="":gosub100:print
  258. 7080 input"is this correct (y/n)";a$
  259. 7081 ifa$<>"y"thenprintchr$(19):forx=1to6:print:nextx
  260. 7082 ifa$<>"y"andhz=1thenforx=1to5:print:nextx
  261. 7083 ifa$<>"y"then7040
  262. 7084 ifgz=1thenwf=1:return
  263. 7085 print#1,ca$:print#1,sc$:print#1,so$:print#1,da$:print#1,re$:print#1,am$
  264. 7087 gosub16:wf=0
  265. 7090 a$="n":goto7081
  266. 7200 gosub20
  267. 7205 printrt$"add data to ";n$:gosub27
  268. 7210 gz=1:gosub7035
  269. 7215 ifca$="!"then500
  270. 7220 n=n+1:ca$(n)=ca$:sc$(n)=sc$:so$(n)=so$:da$(n)=da$:re$(n)=re$:am$(n)=am$
  271. 7240 ip$="added    ":gosub100:printu$:gosub16
  272. 7250 input"add more (y/n)";k$:ip$=" ":gosub100:print
  273. 7251 ifk$="y"thenprintchr$(19):forx=1to4:print:nextx:goto7210
  274. 7252 goto500
  275. 7400 gosub20:printrt$"delete from file ";n$:gosub27
  276. 7406 gosub50:ife=1thenwf=0:goto500
  277. 7410 n=n-1:ford=cton
  278. 7412 ca$(d)=ca$(d+1):sc$(d)=sc$(d+1):so$(d)=so$(d+1):da$(d)=da$(d+1)
  279. 7414 re$(d)=re$(d+1):am$(d)=am$(d+1):nextd
  280. 7418 ip$="record deleted":gosub100:print:wf=1:goto500
  281. 7600 gosub20
  282. 7605 printrt$"change data in ";n$:gosub21
  283. 7610 gosub50:ife=1thenwf=0:goto500
  284. 7620 gz=1:hz=1
  285. 7625 gosub7040:wf=1
  286. 7630 ca$(c)=ca$:sc$(c)=sc$:so$(c)=so$:da$(c)=da$:re$(c)=re$:am$(c)=am$
  287. 7635 ip$="data changed":gosub100:print:gz=0:hz=0:goto500
  288. 7800 gosub20
  289. 7810 printrt$" merge two files                        "
  290. 7820 print:input"enter first file name";f1$
  291. 7830 print:print:input"enter second file name";f2$
  292. 7835 gosub27
  293. 7840 print:print:input"enter  new file name";f3$
  294. 7850 print:printrt$" is this correct? (y/n)                 "
  295. 7860 geta$:ifa$=""then7860
  296. 7870 ifa$="y"then7890
  297. 7875 ifa$="n"then7800
  298. 7880 ifa$<>"n"then7860
  299. 7890 gosub20:print"<merging files>"
  300. 7895 print#15,"c0:"+f3$+"=0:"+f1$+",0:"+f2$"
  301. 7898 [141]26:[153]:ip$[178]" ":[141]100
  302. 7900 [153]"if disk status is okay - merge complete":[153]:[153]
  303. 7910 [141]22:[137]500
  304.