home *** CD-ROM | disk | FTP | other *** search
- 18 print"[147]":poke53280,0:poke53281,0
- 19 print"****************************************";
- 20 print"* budget-master *";
- 21 print"** by **";
- 22 print"* dennis bloomfield *";
- 23 print"****************************************"
- 24 :
- 26 ni=16
- 27 fl=0:p=0:mc$="janfebmaraprmayjunjulaugsepoctnovdecxxx"
- 28 in$="0":hd$=""
- 29 bl$=" "
- 30 dim i$(ni),h$(3),am(2,ni):readi$(0)
- 31 open2,8,2,"budget.file"
- 32 forde=1toni:input#2,i$(de),am(0,de):next:close2
- 33 forde=0to3:readh$(de):next
- 34 a$="":z$="":o$="":nd$="mon-yr":na$=nd$:of$="":nf$=""
- 35 m1$="[158]return for menu[154]"
- 50 printhd$;tab(8);"[158]hit any key to continue"
- 55 gosub1090
- 100 p=0:print"[147] menu ";
- 102 print" currently working on: ";na$;" [146]";
- 104 print" [158]g[154]enerate/alter catagories"
- 105 print" [158]c[154]urrent budget to screen"
- 110 print" [158]e[154]nter/alter monthly data"
- 115 print" [158]p[154]rint current budget"
- 120 print" [158]s[154]ave current budget"
- 125 print" [158]l[154]oad data file"
- 130 print" [158]r[154]eport generator"
- 132 print" [158]d[154]isc command menu"
- 135 print" [158]q[154]uit budget program"
- 140 print" selection? "
- 150 a=0:gosub1090:gosub1010:ifa<1ora>9thengosub998:goto100
- 155 ifa<4ora=7then180
- 160 gosub930
- 175 ifa$<>"y"then100
- 180 onagosub200,300,400,500,600,700,2050,800,60000
- 185 ifa=9thengosub62000:rem write file
- 190 fl=0:lc=0:goto100
- 200 sp$=" ":print"[147] ";:forde=0to1:printh$(de);sp$;:next
- 205 printh$(2);:sp$=" ":printsp$;h$(3);" [154]":gosub960
- 210 forde=1toni:gosub950
- 211 ifde=>10thenprint" ";
- 212 ifde<10thenprint" ";
- 214 printde;i$(de);:d=am(0,de):gosub992:printsp$;
- 217 printam(0,de);
- 220 forr=1to2:d=am(r,de):gosub992:printsp$;
- 225 ifr=2then227
- 226 printam(r,de);:next
- 227 printam(r,de):next:next
- 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] ";
- 230 print" ";i$(0);"[157] ";
- 240 gosub970:d=am(0,0):gosub992:printsp$;
- 250 printam(0,0);
- 260 forr=1to2:de=0:d=am(r,de):gosub992:printsp$;
- 265 ifr=2then267
- 266 printam(r,de);:next
- 267 printam(r,de):next
- 269 iffl<>0then298
- 270 print"[154] income:"+in$+" ideal balance: ";(in-am(0,0))
- 280 print" actual balance:";(in-am(1,0))
- 296 printhd$;" [158]hit any key to continue[154]"
- 297 gosub1090:printhd$;bl$;:return
- 298 return
- 300 fl=1:gosub200:printhd$;"[145] [158] return , in , or item # [154]"
- 310 n$="":printhd$;:input" item number";n$
- 312 ifn$="in"thengosub360:goto300
- 313 ifn$=""then350
- 314 n=val(n$)
- 315 ifn>niorn<1thengosub998:goto310
- 320 printhd$;"[145][145] the current value of ";i$(n);" = ";am(1,n)
- 325 print" [158] return, menu, + or - amount [154]":printbl$
- 330 z$="":input"[145][145] new amount ";z$
- 331 ifz$=""then300
- 332 ifz$="m"then350
- 333 o$=left$(z$,1)
- 334 ifo$<>"+"ando$<>"-"then320
- 335 m$=right$(z$,len(z$)-1):m=val(m$)
- 336 ifo$="-"thenam(1,n)=am(1,n)-m
- 337 ifo$="+"thenam(1,n)=am(1,n)+m
- 340 goto300
- 350 print"":return
- 360 printhd$;" current income is: ";in
- 365 input" new income";in$
- 366 ifin$=""thenreturn
- 367 o$=left$(in$,1)
- 368 ifo$<>"+"ando$<>"-"thenprinthd$;"";bl$;"[145]";:goto365
- 369 m$=right$(in$,len(in$)-1):m=val(m$)
- 370 ifo$="-"thenin=in-m
- 371 ifo$="+"thenin=in+m
- 375 in$=str$(in):return
- 400 s2$=" ":lc=lc+32
- 401 print"[147][158]printer ready? (y)"
- 402 print"any other key to abort":gosub1090:ifa$="y"then406
- 403 ifa$<>"y"andp=0thenprint"print-out aborted"
- 404 ifa$<>"y"andp=>1thenprint"report terminated":re=nm
- 405 forde=1to1000:next:return
- 406 print"[147]":forde=1toni:gosub950:next:gosub960:gosub970:open4,4
- 407 print#4,s2$;s2$;" ";chr$(14);na$;chr$(15);:print#4,chr$(10)
- 408 print#4," ";:forr=0to3:print#4,h$(r);:ifr<>3thenprint#4,s2$;
- 409 next:print#4,chr$(13)
- 410 forr=1to68:print#4,chr$(163);:next
- 411 forr=1to3:print#4:next
- 412 s2$=" "
- 413 forde=1toni
- 415 ifde<10thenprint#4," ";
- 416 ifde=>10thenprint#4," ";
- 420 print#4,de;"-";i$(de);
- 425 forr=0to2:d=am(r,de):gosub992
- 430 print#4,s2$+sp$;
- 432 ifr=3thenprint#4," ";
- 435 print#4,am(r,de);:next:print#4:next
- 440 print#4:print#4:forr=1to68:print#4,chr$(163);:next
- 442 gosub960:print#4:print#4," ";i$(0);" ";
- 445 gosub970:forr=0to2:de=0:d=am(r,de):gosub992
- 450 print#4,s2$+sp$;
- 452 ifr=3thenprint#4," ";
- 455 print#4,am(r,de);:next:print#4
- 460 print#4:print#4," income . . . . . . . . .";
- 462 d=in:gosub992:print#4,sp$;d
- 465 print#4," ideal balance . . . . .";
- 467 d=(in-am(0,0)):gosub992:print#4,sp$;d
- 470 print#4," actual balance . . . . .";
- 472 d=(in-am(1,0)):gosub992:print#4,sp$;d
- 474 ifp>0then496
- 475 print"another copy? (y)"
- 478 gosub1090:ifa$<>"y"then496
- 488 iflc>32thenlc=0:forr=1to2:print#4:next
- 490 print#4:close4:print"[147]":forde=1to1000:next:goto400
- 495 iflc>32thenlc=0:forr=1to2:print#4:next:goto497
- 496 iflc>32thenlc=0
- 497 print#4:close4
- 498 return
- 500 print"[147][154]";m1$
- 501 print"file to save: [158]";na$:print"[154]filename ok? (y-n)"
- 502 gosub1090:ifa$=chr$(13)thenreturn
- 503 ifa$<>"y"thengosub980:goto500
- 507 print"saving: [158]";na$
- 510 open15,8,15
- 511 open2,8,2,"@0:"+na$+",s,w"
- 515 print#2,in$
- 516 forde=0toni
- 517 print#2,i$(de)
- 518 next
- 520 forde=0toni
- 521 forr=0to2
- 522 print#2,am(r,de)
- 523 next
- 524 next
- 530 fl=fl+1:gosub630:return
- 600 print"[147][154]";m1$
- 601 print"file to load: [158]";na$:print"[154]filename ok? (y-n)"
- 602 gosub1090:ifa$=chr$(13)thenreturn
- 603 ifa$<>"y"thengosub980:goto600
- 606 print"loading: [158]";na$
- 610 open15,8,15
- 611 open2,8,2,"0:"+na$+",s,r"
- 615 input#2,in$
- 616 in=val(in$)
- 617 forde=0toni
- 618 input#2,i$(de)
- 619 next
- 620 forde=0toni
- 621 forr=0to2
- 622 input#2,am(r,de)
- 623 next
- 624 next
- 630 input#15,e1$,e2$,e3$,e4$
- 635 print" ";e1$;" ";e2$;" ";e3$;" ";e4$;" ":forde=1to700:next
- 636 ife2$<>"ok"andp=0andfl=0thengosub900
- 640 close2
- 645 close15,8,15:return
- 700 print"[147]";m1$:print"[158]p[146]rinter or [158]s[146]creen?"
- 701 gosub1090:ifa$=chr$(13)thenreturn
- 702 ifa$<>"p"anda$<>"s"thengosub998:print"[147][158]";:goto700
- 703 gosub920
- 705 print"[158]starting":gosub981:ifna$=nd$thenreturn
- 710 input"[158]number of months to report";nm:ifnm=0thenreturn
- 711 ifnm>12then700
- 715 ifa$="p"then750
- 720 forre=1tonm:gosub798:print"[147]":gosub606
- 725 print"[147]report for month of: [158]";na$;"[154]":forde=1to2000:next
- 726 ife2$="ok"then730
- 727 ife2$<>"ok"thenprint"[158]";na$;" ";e2$
- 728 print"report terminated[154]":gosub900:goto742
- 730 gosub200:yi=yi+in:y1=y1+(in-am(0,0)):y2=y2+(in-am(1,0))
- 735 print"[147]report totals to:[158] ";na$;"[154]"
- 739 de=0:print"income total [158]";:d=yi:gosub992:printsp$;yi
- 740 print"[154]ideal bal. total [158]";:d=y1:gosub992:printsp$;y1
- 741 print"[154]actual bal. total[158]";:d=y2:gosub992:printsp$;y2
- 742 ife2$="ok"then745
- 744 forde=1to2000:next:return
- 745 gosub296
- 746 ifre=nmthen749
- 747 gosub1110
- 748 next:return
- 749 next:return
- 750 forre=1tonm:p=p+1:gosub798
- 753 print"[147]":gosub606
- 754 ife2$<>"ok"then756
- 755 goto760
- 756 print"[147]";na$;" ";e2$;"--report terminated"
- 757 open4,4:print#4:print#4:print#4
- 758 print#4," ";na$;" ";e2$;"-report terminated"
- 759 close4,4:goto765
- 760 gosub400:ifa$<>"y"andre=nmandp=nmthen765
- 761 yi=yi+in:y1=y1+(in-am(0,0)):y2=y2+(in-am(1,0))
- 763 gosub1110
- 764 next
- 765 open4,4:ifa$<>"y"then768
- 766 iflc=0thenforde=1to25:print#4:next:goto768
- 767 iflc=32thenforde=1to4:print#4:next
- 768 print#4," report totals":print#4
- 770 print#4," income total [158]";:d=yi:gosub992
- 771 print#4,sp$;yi
- 772 print#4," ideal bal. total [158]";:d=y1:gosub992
- 773 print#4,sp$;y1
- 775 print#4," actual bal. total[158]";:d=y2:gosub992
- 776 print#4,sp$;y2
- 777 print#4
- 778 close4
- 779 return
- 798 forde=0toni:i$(de)="":next:gosub960:gosub970:return
- 800 print"[147][154]":goto63000
- 900 gosub976:gosub975:de=0:in$="0":in=0
- 910 gosub950:na$=nd$:return
- 920 yi=0:y1=0:y2=0:return
- 930 print" [158]are you sure?(y)[145]":forde=1to300:next
- 935 print" [145]":forde=1to300:next
- 940 geta$:ifa$=""then930
- 945 return
- 950 am(2,de)=am(0,de)-am(1,de):return
- 960 forr=0to2:am(r,0)=0:next:return
- 970 forr=0to2:forde=1toni:am(r,0)=am(r,0)+am(r,de):next:next:return
- 975 restore:forde=0toni:reada$:i$(de)=a$:next:return
- 976 forr=1to2:forde=0toni:am(r,de)=0:next:next:return
- 980 print"[147][158]return to escape[154]"
- 981 na$="":m$="":input"[158]month name";m$:ifm$=""then990
- 982 ch$=left$(m$,3)
- 983 forde=1to34step3:ifch$=mid$(mc$,de,3)then986
- 984 next
- 985 gosub998::goto980
- 986 y$="":input"year";y$:ify$=""then990
- 987 yr$=right$(y$,2)
- 988 na$=na$+ch$+chr$(45)+yr$
- 990 ifna$=""thenna$=nd$
- 991 return
- 992 ifabs(d)<10thensp$=" ":return
- 993 ifabs(d)<100thensp$=" ":return
- 994 ifabs(d)<1000thensp$=" ":return
- 995 ifabs(d)<10000thensp$=" ":return
- 996 ifabs(d)<100000thensp$=" ":return
- 997 sp$="":return
- 998 printhd$;" [158]invalid input, please do again![154]":forde=1to1500:next
- 999 printhd$;bl$:return
- 1010 ifa$="c"thena=1
- 1020 ifa$="e"thena=2
- 1030 ifa$="p"thena=3
- 1040 ifa$="s"thena=4
- 1050 ifa$="l"thena=5
- 1060 ifa$="r"thena=6
- 1070 ifa$="d"thena=7
- 1075 ifa$="q"thena=8
- 1076 ifa$="g"thena=9
- 1080 return
- 1090 geta$:ifa$=""then1090
- 1100 return
- 1110 forde=1to34step3
- 1115 ifch$=mid$(mc$,de,3)thenna$=(mid$(mc$,de+3,3))+"-"+yr$
- 1120 next:ch$=left$(na$,3):ifch$<>"xxx"thenreturn
- 1125 ifch$="xxx"thench$="jan":y=val(right$(na$,2))
- 1127 ifch$="xxx"thenna$="":ny=y+1:y$=str$(ny)
- 1130 yr$=right$(y$,2):na$=ch$+"-"+yr$:return
- 2003 data"totals"
- 2009 :
- 2010 :
- 2011 :
- 2016 data"item#","ideal","real ","diff."
- 2022 :
- 2023 :
- 2050 a=0:print"[147]";bl$;" disc options ";bl$
- 2055 print"[146]";tab(13);"[158]d[154]irectory"
- 2060 printtab(13);"[158]r[154]ename file"
- 2065 printtab(13);"[158]s[154]cratch file"
- 2070 printtab(13);"[158]f[154]ormat disk"
- 2075 printtab(13);"[158]i[154]nitialize drive"
- 2077 printtab(13);"[158]v[154]alidate disk"
- 2080 printtab(13);"";m1$
- 2082 print"";bl$;" selection? ";bl$
- 2085 gosub1090
- 2090 ifa$="d"thena=1
- 2095 ifa$="r"thena=2
- 2100 ifa$="s"thena=3
- 2105 ifa$="f"thena=4
- 2110 ifa$="i"thena=5
- 2112 ifa$="v"thena=6
- 2115 ifa$=chr$(13)thenreturn
- 2120 ifa<1ora>6then2050
- 2125 onagosub2135,2225,2265,2295,2355,2365
- 2130 goto2050
- 2135 print"[147][158]any key to pause/restart listing[154]":print:open1,8,0,"$0"
- 2140 get#1,a$,b$
- 2145 get#1,a$,b$
- 2150 get#1,a$,b$
- 2155 c=0
- 2160 ifa$<>""thenc=asc(a$)
- 2165 ifb$<>""thenc=c+asc(b$)*256
- 2167 ifc<10thenprint" ";
- 2170 print" ";mid$(str$(c),2);tab(4);" ";
- 2175 get#1,b$:ifst<>0then2215
- 2180 ifb$<>chr$(34)then2175
- 2185 get#1,b$:ifb$<>chr$(34)thenprintb$;:goto2185
- 2190 get#1,b$:ifb$=chr$(32)then2190
- 2195 printtab(28);:c$=""
- 2200 c$=c$+b$:get#1,b$:ifb$<>""then2200
- 2205 printleft$(c$,3)
- 2206 geta$:ifa$<>""thenprint:print"";m1$
- 2208 ifa$<>""thengosub1090:ifa$=chr$(13)then2220
- 2210 ifst=0then2145
- 2215 print"[157]blocks free"
- 2220 close1:ifa$=chr$(13)then2222
- 2221 print:gosub296
- 2222 return
- 2225 print"[147]";m1$
- 2228 of$="":input"old filename";of$
- 2229 ifof$=""then2260
- 2230 nf$="":input"new filename";nf$
- 2235 ifnf$=""then2260
- 2240 open15,8,15:print#15,"r0:"+nf$+"="+of$
- 2245 input#15,e1$,e2$,e3$,e4$
- 2250 print"[158]";e1$;" ";e2$;" ";e3$;" ";e4$;"[146]":forde=1to1000:next
- 2255 close15,8,15
- 2260 return
- 2265 gosub930:ifa$<>"y"then2290
- 2268 print"[147]";m1$
- 2270 of$="":input"filename to scratch";of$
- 2275 ifof$=""then2290
- 2280 open15,8,15:print#15,"s0:"+of$
- 2285 gosub 2245
- 2290 return
- 2295 gosub930:ifa$<>"y"then2350
- 2298 print"[147]";m1$
- 2300 print"input disc name (16 char. max)"
- 2302 of$="":input"name: ";of$
- 2312 iflen(of$)>16thengosub998:goto2298
- 2325 ifof$=""then2350
- 2330 print"input disc id code (2 char. max)"
- 2331 nf$="":input"id code: ";nf$
- 2332 iflen(nf$)>2thengosub998:goto2298
- 2335 ifnf$=""then2350
- 2340 open15,8,15:print#15,"n0:"+of$+","+nf$
- 2345 gosub2245
- 2350 return
- 2355 print"[147]initializing drive"
- 2360 open15,8,15:print#15,"i0:":print"";:gosub2245:return
- 2365 print"[147]validating disc"
- 2370 open15,8,15:print#15,"v0:":print"";:gosub2245:return
- 60000 rem enter/alter catagories
- 60010 print"[147]"
- 60020 printspc(10)"1. edit/change catagories"
- 60030 printspc(10)"2. edit/change ideal amounts"
- 60040 print"which ?"
- 60045 poke198,0:wait198,1:getz$:ifz$="\"thenreturn
- 60047 ifz$<>"1"andz$<>"2"thenpoke53280,rnd(1)*15:goto60045
- 60050 ifz$="2"then61000
- 60060 print"[147] edit/change catagories"
- 60070 forde=1toni:de$=str$(de):printmid$(de$,len(de$)-1)". "i$(de):next
- 60080 input"change which ? [157][157][157][157][157][157]";cn$:cn=val(cn$):ifcn$="\"then60000
- 60085 ifcn<1orcn>nithenprint"try a number between 1 and"ni"[145][145][145]":goto60080
- 60087 print"change "i$(cn)" to: [157][157][157][157][157][157][157][157][157][157]";:inputi$(cn)
- 60090 i$(cn)=left$(i$(cn)+" ",5)
- 60095 goto60060
- 61000 print"[147] edit/change ideal amounts"
- 61010 forde=1toni:de$=str$(de):printmid$(de$,len(de$)-1)". ideal amount for ";
- 61012 printi$(de)" is:"am(0,de):next
- 61020 input"change which ? [157][157][157][157][157][157]";cn$:cn=val(cn$):ifcn$="\"then60000
- 61025 ifcn<1orcn>nithenprint"try a number between 1 and"ni"[145][145][145]":goto61020
- 61087 print"change "am(0,cn)" to: [157][157][157][157][157][157][157][157][157][157]";:inputam(0,cn):goto61000
- 62000 rem re-write the file
- 62002 print"please wait...re-writing a file."
- 62005 open15,8,15,"s0:budget.file"
- 62008 open2,8,2,"0:budget.file,s,w"
- 62010 forde=1toni:print".";
- 62020 i$(de)=left$(i$(de)+" ",5)
- 62030 print#2,i$(de)","am(0,de)
- 62040 next
- 62050 close2
- 62060 input#15,er,er$:ifer<>0thenprint"sorry...we had an error:"er,er$:goto50
- 62070 close2:close15:return
- 62999 end
- 63000 rem connect back to l.s.
- 63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
- 63004 poke198,0:poke631,13:poke632,13:poke198,2:end
-