home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 133
/
133.d81
/
uf
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
281 lines
100 rem utilities file 64 copyright 1995 v1.0 by d.b. dumler 01/11/95
110 clr:mt=49152:dv=peek(186):ifdv<8thendv=8
115 ifpeek(762)<>192thenload"pt.ml",dv,1
120 d=dv:ifpeek(999)<>101thenload"dir.ml",dv,1
125 sys57812"menubox c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
130 e=12:dimm$(e),el(e),kw(e),bp(e),ld(e),wa(e),ga(e),gs(e),cf(e),pt$(9)
140 a=211:b=988:m=24:s=54272:printchr$(14);chr$(8):poke965,24
150 sp$="":fori=1to80:sp$=sp$+" ":next
160 p4=1:open15,dv,15:open8,dv,8,"config.data":gosub2180:iferthenclose8:goto40000
170 input#8,nn$,ce,d,rt,p,sa,p1,p2,p3,p4,p5:nn$=" ":fori=1to9:pt$(i)=" "
180 get#8,b$:ifb$=""thenb$=chr$(.)
190 remifb$<>chr$(13)thenpt$(i)=pt$(i)+b$:goto180
200 next:close8:fori=1toe:readm$(i):next
210 poke830,d:n1$="0:util.data "
220 v=13*4096:hx=80:hy=126:ch=1:poke2040,11:pokev+21,.:pokev+39,p3
230 bo=06:bk=00:tx=03:gosub1970:print"[147]"," ";
240 i=700:mm=peek(i):dd=peek(i+1):yy=peek(i+2):goto300
250 ifrt=.then290
260 dz=rt:gosub2260:if(er>.)and(er<>73)thenrt=.:dz=dv:gosub2260:goto290
270 print#15,"t-rd":get#15,yy$,yy$,mm$,dd$:dz=dv:gosub2260
280 yy=asc(yy$):mm=asc(mm$):dd=asc(dd$):goto300
290 gosub3100:sysb,5,10,"[197]nter today's date:":gosub1900:print"",
291 forjj=0to8:poke631+jj,asc("[157]"):next:poke198,9
292 sysmt+66,tx,1,8,"[205][205]/[196][196]/[217][217]":mm=val(mid$(w$,1,2)):dd=val(mid$(w$,4,2))
294 yy=val(mid$(w$,7,2))
300 if(mm<1)or(mm>e)or(dd<1)or(dd>31)or(yy<.)or(yy>99)then250
310 mm$=str$(mm):dd$=str$(dd):yr$=right$(str$(ce+yy),4)
320 pokei,mm:pokei+1,dd:pokei+2,yy
330 dz=d:gosub2170:if(er>.)and(er<>73)then330
340 bo=14:bk=00:tx=03:gosub1970
350 gosub1980:gosub2420:print"[145]"tab(nt)nn$
360 print," - [205][193][201][206] [205][197][206][213] -
370 [153]," 1 ascetch data":[153]," 2 (NULL)ave data
380 print," 3 [197]dit data":ifmuthenprinttab(25)"[145]- "m$(mu)" "yr$
390 print," 4 [196]isplay data":print," 5 [208]rint hardcopy
400 [153]," 6 (NULL)un (NULL)(NULL)right$(NULL)right$(NULL)right$val(NULL) chr$(NULL)atn(NULL)left$ 64"
405 [153]," 7 valxit program":[141]1900:[141]2010
410 [139]ch[178].[167]hy[178]126:ch[178]1:[137]350
420 bk[178]00:tx[178]03:[151]v[170]21,.
430 [145]ch[137]560,640,730,1020,1530,470,440
440 [141]3300:[153]"(NULL)uit? atnre you sure? ((NULL)/(NULL))":[141]3000:q$[178]jj$
450 [139]q$[179][177]"y"[167]hy[178]126:ch[178]1:[137]350
460 [137]40000
470 n3$[178]"(NULL)(NULL)right$(NULL)right$(NULL)right$val(NULL) chr$(NULL)atn(NULL)left$ 64":n4$[178]"ug"
480 [141]3300:[153]"right$s the "n3$" disk":[153]"in drive"dv;
490 [153]"((NULL)/(NULL))":[141]3000:q$[178]jj$:[139]q$[179][177]"y"[167]340
500 dz[178]dv:[141]2170:[139]er[167]330
510 [159]8,dv,8,n4$[170]",p,r":[160]8:[141]2180:[139]er[167]330
520 [153]"load":[158]b,e,10,"left$ang on ...":[153],"(NULL)oading: "n3$
530 [151]646,[194](53281):[153]"load"[199](34)n4$[199](34)","dv:[153]"run
540 fori=631to634:pokei,13:next:poke198,4
550 close15:end
560 bo=6:gosub1970
570 gosub1980:print," - [198][197][212][195][200] [196][193][212][193] -":gosub2290
575 onngoto580,340,570,570
580 open4,d,4,n1$+yf$+",s,r":gosub2180:iferthen630
590 i=1:sysb,m,8,"[145][145][145][145] [198]etching: [213]tilities "yu$" [146][145]
600 [132]4,el(i),kw(i),bp(i),ld(i),wa(i),ga(i),gs(i),cf(i)
610 [139]st[178].[167]i[178]i[170]1:[158]679:[137]600
620 mu[178]i:yr$[178]yu$
630 [160]4:[141]2180:[137]560
640 bo[178]4:[141]1970
650 [141]1980:[153]," - (NULL)atn(NULL)val str$atn(NULL)atn -
660 ifmu<1thenx=4:w$="utilities datato save!":gosub2000:goto340
670 gosub2290:onngoto680,340,650,650
680 print#15,"s"+n1$+yf$:open4,d,4,n1$+yf$+",s,w"
690 sysb,m,8,"[145][145][145][145] [211]aving: [213]tilities "yu$" [146][145]":fori=1tomu
700 print#4,el(i):print#4,kw(i):print#4,bp(i):print#4,ld(i):print#4,wa(i)
710 print#4,ga(i):print#4,gs(i):print#4,cf(i):sys679:next:yr$=yu$
720 close4:gosub2180:goto640
730 bo=8:gosub1970
740 gosub1980:print," - [197][196][201][212] [196][193][212][193] -
750 [139]mu[167][153]," (NULL)hrough "m$(mu)
760 [153],"1. atndd":[153],"2. lenhange":[153],"3. 'str$right$(NULL)(NULL)(NULL)atn(NULL) str$atn(NULL)atn' (NULL)val(NULL)(NULL)
770 print,"4. [205][193][201][206] [205][197][206][213]
780 [141]2450:[139]n[179]1[176]n[177]4[167][153]"on":[137]780
790 [145]n[137]830,800,1020,340
800 [139]mu[179]1[167]x[178]3:w$[178]"utilities datato change!":[141]2000:[137]740
810 [141]3300:[153]"(NULL)hich month? (1-12): ";:[158]mt[170]66,tx,1,2,[196](mu):i[178][197](w$)
815 [141]3310:[139]i[179]1[176]i[177]mu[167]810
820 [137]850:[143] gosub2460:goto850
830 [139]mu[178]e[167][153],"cmdcmd(NULL)he file is full already !":bz[178]1:[141]2220:[137]740
840 i[178]mu[170]1:mu[178]i:[141]3300:[153]m$(i)
845 [141]3310
850 [153]"vallectricity cost: ";:[158]mt[170]66,tx,1,7,[196](el(i)):el(i)[178][197](w$)
860 [141]3310:[139]el(i)[179].[167]850
870 [153]"(NULL)ilowatt-hours used: ";:[158]mt[170]66,tx,1,7,[196](kw(i)):kw(i)[178][197](w$)
880 [141]3310:[139]kw(i)[179].[167]870
890 [153]"(NULL)ocal phone cost: ";:[158]mt[170]66,tx,1,7,[196](bp(i)):bp(i)[178][197](w$)
900 [141]3310:[139]bp(i)[179].[167]890
910 [153]"(NULL)ong dist service cost: ";:[158]mt[170]66,tx,1,7,[196](ld(i)):ld(i)[178][197](w$)
920 [141]3310:[139]ld(i)[179].[167]910
930 [153]"(NULL)ater & sewer cost: ";:[158]mt[170]66,tx,1,7,[196](wa(i)):wa(i)[178][197](w$)
940 [141]3310:[139]wa(i)[179].[167]930
950 [153]"chr$allons of water used: ";:[158]mt[170]66,tx,1,7,[196](ga(i)):ga(i)[178][197](w$)
960 [141]3310:[139]ga(i)[179].[167]950
970 [153]"(NULL)atural gas cost: ";:[158]mt[170]66,tx,1,7,[196](gs(i)):gs(i)[178][197](w$)
980 [141]3310:[139]gs(i)[179].[167]970
990 [153]"chr$as cubic ft used: ";:[158]mt[170]66,tx,1,7,[196](cf(i)):cf(i)[178][197](w$)
1000 [139]cf(i)[179].[167][141]3300:[137]990
1010 [141]2460:[141]2550:[137]740
1020 bo[178]5:[141]1970
1030 [141]1980:[153]," - str$right$(NULL)(NULL)(NULL)atn(NULL) str$atn(NULL)atn -
1040 ifmu<1thenx=6:w$="utilities datato display!":gosub2000:goto340
1050 print,"1. [194]y [205]onth":print,"2. [197]lectricity":print,"3. [212]elephone
1060 [153],"4. (NULL)ater":[153],"5. (NULL)atural chr$as":[153],"6. 'valdit str$ata' (NULL)enu
1070 print,"7. [205]ain [205]enu
1080 [141]2450:[139]n[179]1[176]n[177]7[167][153]"on":[137]1080
1090 [145]n[137]1100,1170,1260,1350,1440,730,340
1100 [141]3300:[153]"(NULL)hich month? (1-12) ";:[158]mt[170]66,tx,1,2,[196](mu):i[178][197](w$)
1105 [139]i[179]1[176]i[177]mu[167][153]:[153]"ononon":[137]1100
1110 [141]2460:[139](i[178]1)[175](mu[177]1)[167][158]b,m,13," +:(NULL)ext month waitononononononon":[137]1140
1120 [139](i[178]mu)[175](mu[177]1)[167][158]b,m,13," -:(NULL)rev month waitononononononon":[137]1140
1130 [139]mu[177]2[167][158]b,m,6," -:(NULL)rev month +:(NULL)ext month waitononononononon
1140 gosub2550:if(q$="-")and(i>1)theni=i-1:goto1110
1150 if(q$="+")and(i<mu)theni=i+1:goto1110
1160 goto1030
1170 print"[147]"tab(18)yr$:printtab(29)"[203][215]":printtab(16)"[197]lec"tab(27)"[200]ours
1180 [153][163]5)"(NULL)onth"[163]16)"lenost"[163]28)"(NULL)sed
1190 printtab(5)"[183][183][183][183][183]"tab(15)"[183][183][183][183][183][183]"tab(27)"[183][183][183][183][183]":t1=.:t2=.
1200 fori=1tomu:t1=t1+el(i):t2=t2+kw(i):r=el(i):gosub2120:q$=str$(kw(i))
1210 printtab(6)m$(i)tab(20-ll)"$"p$tab(32-len(q$))q$:next
1220 printtab(15)"[183][183][183][183][183][183]"tab(27)"[183][183][183][183][183]":q$=str$(int(t2+.5)):r=t1:gosub2120
1230 printtab(5)"[212]otal:"tab(20-ll)"$"p$tab(32-len(q$))q$
1240 r=t1/mu:gosub2120:q$=str$(int(t2/mu+.5))
1250 printtab(6)"[193]vg.:"tab(20-ll)"$"p$tab(32-len(q$))q$:bz=.:gosub2220:goto1030
1260 print"[147]"tab(18)yr$"":printtab(16)"[204]ocal"tab(27)"[204]ong
1270 [153][163]5)"(NULL)onth"[163]16)"(NULL)hone"[163]27)"str$ist"
1280 [153][163]5)"usrusrusrusrusr"[163]15)"usrusrusrusrusrusr"[163]26)"usrusrusrusrusrusr":t1[178].:t2[178].
1290 [129]i[178]1[164]mu:t1[178]t1[170]bp(i):t2[178]t2[170]ld(i):r[178]ld(i):[141]2120:q$[178]p$:r[178]bp(i):[141]2120
1300 [153][163]6)m$(i)[163]20[171]ll)"$"p$[163]31[171][195](q$))"$"q$:[130]
1310 [153][163]15)"usrusrusrusrusrusr"[163]26)"usrusrusrusrusrusr":r[178]t2:[141]2120:q$[178]p$