home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / budget-master (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  393 lines

  1. 18 print"[147]":poke53280,0:poke53281,0
  2. 19 print"****************************************";
  3. 20 print"*             budget-master            *";
  4. 21 print"**                 by                 **";
  5. 22 print"*           dennis bloomfield          *";
  6. 23 print"****************************************"
  7. 24 :
  8. 26 ni=16
  9. 27 fl=0:p=0:mc$="janfebmaraprmayjunjulaugsepoctnovdecxxx"
  10. 28 in$="0":hd$=""
  11. 29 bl$="                                        "
  12. 30 dim i$(ni),h$(3),am(2,ni):readi$(0)
  13. 31 open2,8,2,"budget.file"
  14. 32 forde=1toni:input#2,i$(de),am(0,de):next:close2
  15. 33 forde=0to3:readh$(de):next
  16. 34 a$="":z$="":o$="":nd$="mon-yr":na$=nd$:of$="":nf$=""
  17. 35 m1$="[158]return for menu[154]"
  18. 50 printhd$;tab(8);"[158]hit any key to continue"
  19. 55 gosub1090
  20. 100 p=0:print"[147]                 menu                   ";
  21. 102 print"      currently working on: ";na$;"      [146]";
  22. 104 print"        [158]g[154]enerate/alter catagories"
  23. 105 print"        [158]c[154]urrent budget to screen"
  24. 110 print"        [158]e[154]nter/alter monthly data"
  25. 115 print"        [158]p[154]rint current budget"
  26. 120 print"        [158]s[154]ave current budget"
  27. 125 print"        [158]l[154]oad data file"
  28. 130 print"        [158]r[154]eport generator"
  29. 132 print"        [158]d[154]isc command menu"
  30. 135 print"        [158]q[154]uit budget program"
  31. 140 print"               selection?               "
  32. 150 a=0:gosub1090:gosub1010:ifa<1ora>9thengosub998:goto100
  33. 155 ifa<4ora=7then180
  34. 160 gosub930
  35. 175 ifa$<>"y"then100
  36. 180 onagosub200,300,400,500,600,700,2050,800,60000
  37. 185 ifa=9thengosub62000:rem write file
  38. 190 fl=0:lc=0:goto100
  39. 200 sp$="     ":print"[147]    ";:forde=0to1:printh$(de);sp$;:next
  40. 205 printh$(2);:sp$="  ":printsp$;h$(3);"    [154]":gosub960
  41. 210 forde=1toni:gosub950
  42. 211 ifde=>10thenprint"   ";
  43. 212 ifde<10thenprint"    ";
  44. 214 printde;i$(de);:d=am(0,de):gosub992:printsp$;
  45. 217 printam(0,de);
  46. 220 forr=1to2:d=am(r,de):gosub992:printsp$;
  47. 225 ifr=2then227
  48. 226 printam(r,de);:next
  49. 227 printam(r,de):next:next
  50. 228 print"    [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]      ";
  51. 230 print"    ";i$(0);"[157]  ";
  52. 240 gosub970:d=am(0,0):gosub992:printsp$;
  53. 250 printam(0,0);
  54. 260 forr=1to2:de=0:d=am(r,de):gosub992:printsp$;
  55. 265 ifr=2then267
  56. 266 printam(r,de);:next
  57. 267 printam(r,de):next
  58. 269 iffl<>0then298
  59. 270 print"[154]    income:"+in$+" ideal balance: ";(in-am(0,0))
  60. 280 print"          actual balance:";(in-am(1,0))
  61. 296 printhd$;"        [158]hit any key to continue[154]"
  62. 297 gosub1090:printhd$;bl$;:return
  63. 298 return
  64. 300 fl=1:gosub200:printhd$;"[145]    [158]    return , in , or item #    [154]"
  65. 310 n$="":printhd$;:input"    item number";n$
  66. 312 ifn$="in"thengosub360:goto300
  67. 313 ifn$=""then350
  68. 314 n=val(n$)
  69. 315 ifn>niorn<1thengosub998:goto310
  70. 320 printhd$;"[145][145]    the current value of ";i$(n);" = ";am(1,n)
  71. 325 print"    [158]  return, menu,  + or - amount [154]":printbl$
  72. 330 z$="":input"[145][145]    new amount   ";z$
  73. 331 ifz$=""then300
  74. 332 ifz$="m"then350
  75. 333 o$=left$(z$,1)
  76. 334 ifo$<>"+"ando$<>"-"then320
  77. 335 m$=right$(z$,len(z$)-1):m=val(m$)
  78. 336 ifo$="-"thenam(1,n)=am(1,n)-m
  79. 337 ifo$="+"thenam(1,n)=am(1,n)+m
  80. 340 goto300
  81. 350 print"":return
  82. 360 printhd$;"    current income is: ";in
  83. 365 input"    new income";in$
  84. 366 ifin$=""thenreturn
  85. 367 o$=left$(in$,1)
  86. 368 ifo$<>"+"ando$<>"-"thenprinthd$;"";bl$;"[145]";:goto365
  87. 369 m$=right$(in$,len(in$)-1):m=val(m$)
  88. 370 ifo$="-"thenin=in-m
  89. 371 ifo$="+"thenin=in+m
  90. 375 in$=str$(in):return
  91. 400 s2$="           ":lc=lc+32
  92. 401 print"[147][158]printer ready? (y)"
  93. 402 print"any other key to abort":gosub1090:ifa$="y"then406
  94. 403 ifa$<>"y"andp=0thenprint"print-out  aborted"
  95. 404 ifa$<>"y"andp=>1thenprint"report terminated":re=nm
  96. 405 forde=1to1000:next:return
  97. 406 print"[147]":forde=1toni:gosub950:next:gosub960:gosub970:open4,4
  98. 407 print#4,s2$;s2$;"      ";chr$(14);na$;chr$(15);:print#4,chr$(10)
  99. 408 print#4,"       ";:forr=0to3:print#4,h$(r);:ifr<>3thenprint#4,s2$;
  100. 409 next:print#4,chr$(13)
  101. 410 forr=1to68:print#4,chr$(163);:next
  102. 411 forr=1to3:print#4:next
  103. 412 s2$="        "
  104. 413 forde=1toni
  105. 415 ifde<10thenprint#4,"   ";
  106. 416 ifde=>10thenprint#4,"  ";
  107. 420 print#4,de;"-";i$(de);
  108. 425 forr=0to2:d=am(r,de):gosub992
  109. 430 print#4,s2$+sp$;
  110. 432 ifr=3thenprint#4,"  ";
  111. 435 print#4,am(r,de);:next:print#4:next
  112. 440 print#4:print#4:forr=1to68:print#4,chr$(163);:next
  113. 442 gosub960:print#4:print#4,"     ";i$(0);" ";
  114. 445 gosub970:forr=0to2:de=0:d=am(r,de):gosub992
  115. 450 print#4,s2$+sp$;
  116. 452 ifr=3thenprint#4,"  ";
  117. 455 print#4,am(r,de);:next:print#4
  118. 460 print#4:print#4,"                  income . . . . . . . . .";
  119. 462 d=in:gosub992:print#4,sp$;d
  120. 465 print#4,"                  ideal balance  . . . . .";
  121. 467 d=(in-am(0,0)):gosub992:print#4,sp$;d
  122. 470 print#4,"                  actual balance . . . . .";
  123. 472 d=(in-am(1,0)):gosub992:print#4,sp$;d
  124. 474 ifp>0then496
  125. 475 print"another copy? (y)"
  126. 478 gosub1090:ifa$<>"y"then496
  127. 488 iflc>32thenlc=0:forr=1to2:print#4:next
  128. 490 print#4:close4:print"[147]":forde=1to1000:next:goto400
  129. 495 iflc>32thenlc=0:forr=1to2:print#4:next:goto497
  130. 496 iflc>32thenlc=0
  131. 497 print#4:close4
  132. 498 return
  133. 500 print"[147][154]";m1$
  134. 501 print"file to save: [158]";na$:print"[154]filename ok? (y-n)"
  135. 502 gosub1090:ifa$=chr$(13)thenreturn
  136. 503 ifa$<>"y"thengosub980:goto500
  137. 507 print"saving: [158]";na$
  138. 510 open15,8,15
  139. 511 open2,8,2,"@0:"+na$+",s,w"
  140. 515 print#2,in$
  141. 516 forde=0toni
  142. 517 print#2,i$(de)
  143. 518 next
  144. 520 forde=0toni
  145. 521 forr=0to2
  146. 522 print#2,am(r,de)
  147. 523 next
  148. 524 next
  149. 530 fl=fl+1:gosub630:return
  150. 600 print"[147][154]";m1$
  151. 601 print"file to load: [158]";na$:print"[154]filename ok? (y-n)"
  152. 602 gosub1090:ifa$=chr$(13)thenreturn
  153. 603 ifa$<>"y"thengosub980:goto600
  154. 606 print"loading: [158]";na$
  155. 610 open15,8,15
  156. 611 open2,8,2,"0:"+na$+",s,r"
  157. 615 input#2,in$
  158. 616 in=val(in$)
  159. 617 forde=0toni
  160. 618 input#2,i$(de)
  161. 619 next
  162. 620 forde=0toni
  163. 621 forr=0to2
  164. 622 input#2,am(r,de)
  165. 623 next
  166. 624 next
  167. 630 input#15,e1$,e2$,e3$,e4$
  168. 635 print"    ";e1$;" ";e2$;" ";e3$;" ";e4$;" ":forde=1to700:next
  169. 636 ife2$<>"ok"andp=0andfl=0thengosub900
  170. 640 close2
  171. 645 close15,8,15:return
  172. 700 print"[147]";m1$:print"[158]p[146]rinter or [158]s[146]creen?"
  173. 701 gosub1090:ifa$=chr$(13)thenreturn
  174. 702 ifa$<>"p"anda$<>"s"thengosub998:print"[147][158]";:goto700
  175. 703 gosub920
  176. 705 print"[158]starting":gosub981:ifna$=nd$thenreturn
  177. 710 input"[158]number of months to report";nm:ifnm=0thenreturn
  178. 711 ifnm>12then700
  179. 715 ifa$="p"then750
  180. 720 forre=1tonm:gosub798:print"[147]":gosub606
  181. 725 print"[147]report for month of: [158]";na$;"[154]":forde=1to2000:next
  182. 726 ife2$="ok"then730
  183. 727 ife2$<>"ok"thenprint"[158]";na$;" ";e2$
  184. 728 print"report terminated[154]":gosub900:goto742
  185. 730 gosub200:yi=yi+in:y1=y1+(in-am(0,0)):y2=y2+(in-am(1,0))
  186. 735 print"[147]report totals to:[158] ";na$;"[154]"
  187. 739 de=0:print"income total     [158]";:d=yi:gosub992:printsp$;yi
  188. 740 print"[154]ideal bal. total [158]";:d=y1:gosub992:printsp$;y1
  189. 741 print"[154]actual bal. total[158]";:d=y2:gosub992:printsp$;y2
  190. 742 ife2$="ok"then745
  191. 744 forde=1to2000:next:return
  192. 745 gosub296
  193. 746 ifre=nmthen749
  194. 747 gosub1110
  195. 748 next:return
  196. 749 next:return
  197. 750 forre=1tonm:p=p+1:gosub798
  198. 753 print"[147]":gosub606
  199. 754 ife2$<>"ok"then756
  200. 755 goto760
  201. 756 print"[147]";na$;" ";e2$;"--report terminated"
  202. 757 open4,4:print#4:print#4:print#4
  203. 758 print#4,"              ";na$;" ";e2$;"-report terminated"
  204. 759 close4,4:goto765
  205. 760 gosub400:ifa$<>"y"andre=nmandp=nmthen765
  206. 761 yi=yi+in:y1=y1+(in-am(0,0)):y2=y2+(in-am(1,0))
  207. 763 gosub1110
  208. 764 next
  209. 765 open4,4:ifa$<>"y"then768
  210. 766 iflc=0thenforde=1to25:print#4:next:goto768
  211. 767 iflc=32thenforde=1to4:print#4:next
  212. 768 print#4,"                           report totals":print#4
  213. 770 print#4,"                     income total     [158]";:d=yi:gosub992
  214. 771 print#4,sp$;yi
  215. 772 print#4,"                     ideal bal. total [158]";:d=y1:gosub992
  216. 773 print#4,sp$;y1
  217. 775 print#4,"