home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 87
/
087.d81
/
myb
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
24KB
|
627 lines
10 poke56,144:poke55,0:clr:de=peek(186):ifde<8thende=8
15 ifpeek(2048)=0thenload"inventory font",de,1
20 dimma$(6),edit$(4),prnt$(2),ca$(1),s$(10),n(10),su$(8),sy$(8),vec(8,2)
25 dimbu$(8),li(8),offset(8),em$(8),c$(8),it$(100,3),ps$(7),pi$(6),cp$(8),cb$(8)
30 close15:open15,de,15,"r:inv.system=inv.system":input#15,a:poke53272,19
35 ifa<>63thengosub6830:goto45
40 open2,de,2,"inv.system,s,r":fori=1to6:input#2,sy$(i):next:close2
45 print#15,"r:invoice.set.myb=invoice.set.myb":input#15,a
50 ifa<>63thengosub7260:goto60
55 open2,de,2,"invoice.set.myb,s,r":fori=1to6:input#2,pi$(i):next:close2
60 print#15,"r:tax rate.myb=tax rate.myb":input#15,a
65 ifa<>63thentr=.05:goto75
70 open2,de,2,"tax rate.myb,s,r":input#2,tr:close2
75 print#15,"r:header.myb=header.myb":input#15,a
80 ifa<>63thengosub7890:goto90
85 open2,de,2,"header.myb,s,r":input#2,hl:fori=1tohl:input#2,hd$(i):next:close2
90 fori=1to6:readma$(i):next
95 fori=1to4:readed$(i):next
100 fori=1to2:readpr$(i):next
105 readca$(0),ca$(1):f=128
110 fori=1to10:reads$(i):next
115 fori=1to9:readn(i):next
120 fori=1to8:readsu$(i):next
125 fori=1to8:readvectrs(i,0),vec(i,1),vec(i,2):next
130 fori=1to8:readlimits(i):next
135 fori=1to8:readoffsets(i):next
140 fori=1to8:readem$(i):next
145 fori=1to8:readc$(i):next
150 fori=1to7:readps$(i):next
155 fori=1to8:readcp$(i):next
160 ifleft$(hd$(hl),1)="\"thenhl=hl-1:hd$(hl+1)=mid$(hd$(hl+1),2)
165 wi$=" "
166 gosub1100
170 print"";:poke53272,19:poke53280,0:poke53281,0:menu=1
174 print"";:poke53272,19:poke53280,0:poke53281,0:menu=1
175 sys49152,"[205] [201] [206] [196][160][160][160][217][160][207][160][213][160][210][160][160][160][194][160][213] [211] [201] [206] [197] [211] [211]","[199]o [212]o [215]ork [211]creen"
180 ifpeek(198)<>1thenpoke2048,0:poke53272,23:poke44,8:clr:sys49152+36:end
185 poke198,0:sys49170:sys49167:getdevice$:getmenu$:gethiglight$:gettext$
190 mc=asc(me$)and15:hi=asc(hi$)and15:te=asc(te$)and15:h=hi:t=te:b=mc:de=asc(de$)
195 rem work screen menu setup
300 sys49179,0,39,0,24,0,asc(text$)
310 sys49152+39,"[195][210][211][210] [204][197][198][212]/[210][201][199][200][212] [212][207][160][195][200][193][206][199][197][160][205][197][206][213][211]"
320 print:poke646,hi:print" ";
330 poke646,asc(text$):print" [208]roject [197]dit [197]xpansion ";
340 poke646,asc(menu$):print" ";
350 onmenugoto360,430,490
360 menu=1:sys49173:geta$:ifa$<>""then360
370 sys49158,5:sys49179,3,19,3,8,0,asc(menu$)
380 sys49155,70,2,2,mcor128,hi,te,ma$(1),ma$(2),ma$(3),ma$(4),ma$(5),ma$(6)
390 geta$:ifa$="[157]"thensys49161,5:goto490
400 rem sys49161,5:geta$:ifa$="[157]"then380
410 ifa$=""thensys49161,5:goto430
420 sys49152+39,"[146] ":onval(a$)goto6000,2920,2780,7560,175,50010
430 menu=2:sys49173:geta$:ifa$<>""then430
440 sys49158,5:sys49179,14,29,3,6,0,asc(menu$)
450 sys49155,4,13,2,mcor128,hi,te,ed$(1),ed$(2),ed$(3),ed$(4)
460 sys49161,5:geta$:ifa$="[157]"then360
470 ifa$=""then490
480 onval(a$)goto2200,6860,7730,50030
490 menu=3:sys49173:geta$:ifa$<>""then490
500 sys49158,5:sys49179,25,39,3,4,0,mc
510 sys49155,2,24,2,mcor128,hi,te,pr$(1),pr$(2)
520 sys49161,5:geta$:ifa$="[157]"then430
530 ifa$=""then360
540 onval(a$)goto60000,50050
1000 ms$="[196]ata [196]isk [201]n drive"+str$(asc(de$))+"/[210][197][212][213][210][206]"
1010 gosub2000:print:geta$:ifa$="q"thena$="2":return
1020 ifa$<>chr$(13)thengosub1050:ifa$="1"then1010
1030 ifa$="2"thenreturn
1040 return
1050 sys49173:geta$:ifa$=""then1050
1060 sys49155,2,13,13,mcand15,hi,te,ca$(0),ca$(1):geta$:return
1070 rem **** get time ****
1100 fori=8to16:t$="":close15:open15,i,15:close15:ifstthen1140
1110 open15,i,15:print#15,"t-ra":input#15,a$,b$:ifval(a$)then1140
1115 print#15,"t-ra"
1120 get#15,a$:ifa$<>chr$(13)thent$=t$+a$:goto1120
1130 ifval(t$)=0theni=16:goto1140
1140 next
1145 ifval(t$)ort$=""then1200
1150 da$=left$(t$,13)
1160 ti$=mid$(t$,15,2)+mid$(t$,18,2)+mid$(t$,21,2):return
1200 sys49179,0,39,22,24,0,13
1210 poke787,255:sys49152+39,"[212]oday's date? "
1220 sys39424,1,4,37-peek(211):da$=w$:return
1999 rem **** message ****
2000 sys49158,6:sys49179,3,38,09,13,0,asc(me$)
2010 sys36864,3,37,8,12,160,hi,te
2020 poke646,hi:poke199,1:sys39171,20-len(ms$)/2,10,ms$
2030 poke198,0:wait198,15:sys49161,6
2040 return
2050 rem edit invoice
2200 poke646,te:print" [197][196][201][212][160][201][206][214][197][206][212][207][210][217] ":gosub3970
2210 ms$="[196]ata [196]isk [201]n drive:"+sy$(1)+"/[210][197][212][213][210][206]"
2220 gosub2000:print:geta$:ifa$="q"then300
2230 ifa$<>chr$(13)thengosub1050:ifa$="1"then2210
2240 re=1:ifa$="2"then300
2250 close15:pt$=sy$(5)+":":ifsy$(5)="[210][207][207][212]"thenpt$=""
2260 close2:open15,val(sy$(1)),15:open2,val(sy$(1)),2,pt$+"inventory.myb"
2270 input#15,a$,b$,c$,d$:ifval(a$)<>0then2770
2280 sys49152+6,4:gosub2750:sys37123,1,0:gosub4300:rem pos at record 1
2290 sys49152+39," [145]":print:poke646,hi:print" [213][208]/[196][207][215][206] [146]";:poke646,te
2300 print" [206]ext/[208]rev ";:poke646,hi:print" [205] [146]";:poke646,te:print" [205]enu ";
2310 poke646,hi:print" [209] [146]";:poke646,te:print" [209]uit"
2320 geta$:ifa$=""then2320
2330 ifa$=""then2580
2340 ifa$="[145]"then2560
2350 ifa$="g"thengosub4620:goto2290
2355 ifa$="r"then2570
2360 ifa$="c"thengosub4680:goto2290
2370 ifa$="s"thengosub4710:goto2290
2380 ifa$="m"thengosub2440:goto2330
2390 ifa$="w"ora$="p"thengosub4430:goto2290
2400 ifa$="e"thenfori=1to8:bu$(i)="":next:gosub4330:goto2610
2410 ifa$="q"thenclose2:goto300
2420 goto2320
2430 rem edit menu
2440 sys49152+6,2:sys49179,7,34,9,18,0,mc
2450 sys49155,8+64,6,9,mcand15,hi,te,em$(1),em$(2),em$(3),em$(4),em$(5),em$(6),em$(7),em$(8)
2460 sys49152+9,2:geta$:onval(a$)goto2470,2480,2490,2510,2520,2530,2530,2540
2470 a$="w":return
2480 a$="r":return
2490 a$="e":return
2500 a$="d":return
2510 a$="g":return
2520 a$="c":return
2530 return
2540 a$="q":return
2550 rem crsr up
2560 rec=rec+1:sys37123,rec,offset(1):input#15,z$,z$:ifz$<>"ok"thengosub4560
2570 sys49152+9,4:gosub2750:gosub4300:goto2290
2580 rec=rec-1:ifrec<1thengosub4510
2590 goto2570
2600 rem choose field of invoice to edit
2610 it=1
2620 sys39168,2,vec(it,1),vec(it,0),vec(it,2)+vec(it,0),te
2630 sys49152+39,"[195][210][211][210]/[210][197][212][213][210][206] to select [216] to [197]xit"
2640 geta$:ifa$=""then2640
2650 ot=it:ifa$="q"thensys39168,1,ve(it,1),ve(it,0),ve(it,2)+ve(it,0),hi
2660 ifa$="q"ora$="x"then2290
2670 ifa$=""thenit=it+1:ifit>8thenit=1
2680 ifa$="[145]"thenit=it-1:ifit<1thenit=8
2690 ifa$="w"thengosub4430:goto2620
2700 ifa$<>chr$(13)thengosub2730:goto2640
2710 ifa$<>chr$(13)then2640
2720 gosub4160:sys39168,1,vec(it,1),vec(it,0),vec(it,2)+vec(it,0),hi:goto2630
2730 sys39168,1,vec(ot,1),vec(ot,0),vec(ot,2)+vec(ot,0),hi
2740 sys39168,2,vec(it,1),vec(it,0),vec(it,2)+vec(it,0),te:return
2750 poke646,hi:sys39171,15,4," [145]":print
2760 printtab(15)"[210]ecord:"re:return
2770 ms$=a$+","+b$+","+c$+","+d$:gosub2000:goto300
2780 menu=1:sys49173:geta$:ifa$=""then2780
2790 m=49155:x=6:y=6:sys49152+39,"[208]lease [211]elect [201]nitial [198]ile [211]ize"
2800 sys49158,5:sys49179,x+1,35,y+1,y+10,0,asc(menu$):t=te
2810 sysm,10,x,y,f,h,t,s$(1),s$(2),s$(3),s$(4),s$(5),s$(6),s$(7),s$(8),s$(9),s$(10)
2820 sys49161,5:geta$:ifa$=":"then300
2830 n=n(val(a$)):pt$=sy$(5)+":":ifsy$(5)="[210][207][207][212]"thenpt$=""
2840 ms$="[196]isk w/"+str$(int(n*166/254))+" blocks in drive "+sy$(1)
2841 sys49152+39,"[210][197][212][213][210][206] to create file. [209] to [209]uit"
2845 gosub2000:getb$:ifb$<>chr$(13)then310
2850 close15:open15,val(sy$(1)),15,"s:"+pt$+"inventory.myb":poke186,val(sy$(1))
2860 sys49152+39,"[195]reating [201]nventory [198]ile..."
2870 sys37120,pt$+"inventory.myb",166,n
2880 close2:input#15,a$,ms$
2890 ifa$<>"4?"thenifms$<>"ok"andms$<>"record not present"thengosub2000:geta$
2900 gosub9830:goto300
2910 rem setup system
2920 menu=1:sys49173:geta$:n=val(a$):ifa$=""then2920
2930 m=49155:x=6:y=4
2940 sys49158,5:sys49179,1,38,14,21,32,asc(menu$):gosub3010:gosub3100
2950 sys49152+39,"[208]lease [211]elect [201]