8-Bit Software Online Conversion

:2.$.GASMENU - Listing

10REM: GasMenu 20*FX18 30*KEY0 CLS|M LIST 1990,2080|M A=GET: GOTO430|M 40*KEY1 ?&FE4E=&7F:CALL!-4|M|N 50*KEY8 RUN|M 60*KEY9 MODE135|M|N *FX4|M *FX200|M L ISTO 1|M LIST|M|N 70VDU14 80MODE7:VDU23;8202;0;0;0; 90PROCbasicinfo 100CLS:PROCtitle 110PRINTTAB(9,2)CHR$135CHR$132CHR$157C HR$135"Gas Program Menu "CHR$156 120PRINTTAB(0,4)CHR$141" Press 1 if us ing this Program for the"TAB(0,5)CHR$141 " Press 1 if using this Program for the" TAB(0,6)CHR$141" first time in a 13+ wee k period"TAB(0,7)CHR$141" first time in a 13+ week period" 130PRINTTAB(0,8)CHR$141" Press 2 to en ter readings"TAB(0,9)CHR$141" Press 2 to enter readings" 140PRINTTAB(0,10)CHR$141" Press 3 to s ee readings entered and"TAB(0,11)CHR$141 " Press 3 to see readings entered and"TA B(0,12)CHR$141" total cost of Gas to dat e"TAB(0,13)CHR$141" total cost of Gas to date" 150PRINTTAB(0,14)CHR$141" Press 4 for Electricity Program"TAB(0,15)CHR$141" Pr ess 4 for Electricity Program" 160PRINTTAB(0,16)CHR$141" Press 5 to s elect SOUND On or OFF"TAB(0,17)CHR$141" Press 5 to select SOUND On or OFF" 170PRINTTAB(0,18)CHR$141" Press 6 for Instructions"TAB(0,19)CHR$141" Press 6 f or Instructions" 180PRINTTAB(0,20)CHR$141" Press 7 to Q UIT Program"TAB(0,21)CHR$141" Press 7 to QUIT Program" 190PRINTTAB(6,23)CHR$132CHR$157CHR$135 "Press 1 2 3 4 5 6 or 7 "CHR$156:PROCti ng:A=GET 200IF A<49 OR A>55 THEN PRINTTAB(6,23) CHR$135CHR$157CHR$132"Press 1 2 3 4 5 6 or 7 "CHR$156:PROCrasp:PROCpause:GOTO19 0 210IF A=49 THEN GOTO 300 220IF A=50 THEN GOTO 670 230IF A=51 THEN GOTO 1110 240IF A=52 THEN CHAIN"EleMenu" 250IF A=53 THEN CHAIN"Sound" 260IF A=54 THEN CHAIN"Instruc" 270IF A=55 THEN CHAIN"Quit" 280END 290REM: ***** 300CLS:PRINTTAB(1,1)CHR$141"Did you pr ess 1 by mistake? Y or N?"TAB(1,2)CHR$14 1"Did you press 1 by mistake? Y or N?"TA B(10,3)" -------------------" 310PRINTTAB(0,6)" If you press Y (for YES) then you will"TAB(0,7)" be returned to the Menu and can select" 320PRINTTAB(0,8)" another number/choic e" 330PRINTTAB(0,12)" If you press N (for NO) you will WIPE"TAB(0,13)" OUT ALL PR EVIOUS READINGS and will"TAB(0,14)" then be able to enter new readings for"TAB(0 ,15)" a new 13+ week period." 340PRINTTAB(11,21)CHR$141" Press Y or N"TAB(11)CHR$141" Press Y or N":PROCting :A=GET 350IF A=78 OR A=110 THEN CLS:GOTO370 360IF A=89 OR A=121 THEN RUN 370PROCtitle:PRINTTAB(4,6)"As this is the first time you are"TAB(0,7)"using th is Program, it is ESSENTIAL that"TAB(0,8 )"you should first confirm/amend certain "TAB(0,9)"basic data on the next page." 380PRINTTAB(4,11)"(All these figures a ppear on your"TAB(0,12)"last Gas Bill, a nd should be carefully"TAB(0,13)"checked .)" 390PRINTTAB(5,22)CHR$132CHR$157CHR$135 "Press any key to continue "CHR$156:PRO Cting:A=GET 400*FX138,0,128 410END 420REM: ***** 430CLS:PRINTTAB(0,0)" Week"TAB(10,0)" Reading"TAB(21,0)" Cubic Feet used"TAB(0 ,1)STRING$(40,"-")TAB(0,19)STRING$(40,"- ") 440PRINTTAB(0,18)" Previous " 450X=1:Y=17 460PRINTTAB(3,Y);X:Y=Y-1:X=X+1 470IF Y=8 THEN GOTO 480 ELSE GOTO 460 480 X=10:Y=8 490IF Y<9 THEN PRINTTAB(2,Y);X:Y=Y-1:X =X+1 500IF Y=1 THEN GOTO 510 ELSE GOTO490 510F=OPENOUT("GAS") 520w%=0:Y=18 530IF w%=0 THEN PRINTTAB(0,18)" Previ ous" 540PRINTTAB(3,20)"Enter Previous Readi ng as shown on"TAB(0,21)" your last gas bill":PROCbeep:INPUT;" ";norm readw% 550PRINTTAB(1,23)" Is that correct? Y/ N":A=GET 560IF A=89 OR A=121 THEN PRINTTAB(0,18 )" Previous":GOTO590 570IF A=78 OR A=110 THEN PROCclear:GOT O 540 580PROCrasp:PROCclear:FOR X=1 TO 2000: NEXT X:GOTO 540 590PROCnormunits:PROCclear:PROCnorre:P ROCnorun 600PROCclear:PROCwait 610PRINT#F,w%,normreadw%,normunitsw% 620PROCclear:PRINTTAB(4,20)CHR$141"Fil e GAS is now being CREATED"TAB(4,21)CHR$ 141"File GAS is now being CREATED":PROCp ause 630CLOSE#F 640PROCclear:PRINTTAB(3,20)CHR$141" Fi le GAS has been CREATED O.K."TAB(3,21)CH R$141" File GAS has been CREATED O.K." 650PROCpause:RUN 660REM: ***** 670ON ERROR GOTO 1060 680CLS:PRINTTAB(0,0)" Week"TAB(10,0)" Reading"TAB(21,0)" Cubic Feet used"TAB(0 ,1)STRING$(40,"-")TAB(0,19)STRING$(40,"- ") 690PRINTTAB(0,18)" Previous" 700X=1:Y=17 710PRINTTAB(3,Y);X:Y=Y-1:X=X+1 720IF Y=8 THEN GOTO 730 ELSE GOTO 710 730X=10:Y=8 740IF Y<9 THEN PRINTTAB(2,Y);X:Y=Y-1:X =X+1 750IF Y=1 THEN GOTO 760 ELSE GOTO740 760F=OPENUP("GAS") 770w%=0:Y=18 780REPEAT 790INPUT#F,w%,normreadw%,normunitsw% 800IF w%=0 THEN PROCclear:PRINTTAB(0,Y )" Previous":PROCnorre:PROCnorun:PROCnor munits 810IF w%>0 AND w%<10 THEN PROCclear:PR INTTAB(3,Y);w%;:PROCnorre:PROCnorun:PROC normunits 820IF w%>9 THEN PROCclear:PRINTTAB(2,Y );w%:PROCnorre:PROCnorun:PROCnormunits 830w%=w%+1:Y=Y-1 840UNTIL EOF#F 850ON ERROR GOTO 1060 860REPEAT 870PRINTTAB(0,18)" Previous" 880IF w%>0 AND w%<10 THEN GOTO900 890IF w%>9 AND w%<17 THEN GOTO950 900IF w%>0 AND w%<10 THEN PRINTTAB(2,Y );" ";w%;" " 910IF w%>0 AND w%<10 THEN PRINTTAB(2,2 0)"Enter Reading for week ";w%:PROCbeep: INPUT;" ";normreadw%:PRINTTAB(1,22)" Is that correct? Y/N":A=GET 920IF A=89 OR A=121 THEN PROCclear:PRI NTTAB(2,Y);" ";w%:GOTO 1000 930IF A=78 OR A=110 THEN PROCclear:GOT O 910 940PROCclear:GOTO 910 950IF w%>9 AND w%<17 THEN PRINTTAB(1,Y );" ";w%;" " 960IF w%>9 AND w%<17 THEN PRINTTAB(2,2 0)"Enter Reading for week ";w%:PROCbeep: INPUT;" ";normreadw%:PRINTTAB(1,22)" Is that correct? Y/N":A=GET 970IF A=89 OR A=121 THEN PROCclear:PRI NTTAB(1,Y);" ";w%:GOTO1000 980IF A=78 OR A=110 THEN PROCclear:GOT O 960 990PROCclear:GOTO 960 1000PROCnormunits:PROCclear:PROCnorre:P ROCnorun 1010PROCclear:PROCwait 1020PRINT#F,w%,normreadw%,normunitsw% 1030 IF w%>15 THEN PROCclear:PRINTTAB(3 ,20)" Press ESCAPE to SAVE readings to"T AB(3,21)" week ";w%:PROCting:A=GET:PR OCclear:PROCwait:PROCpause:CLOSE#F 1040 IF w%<16 THEN PROCclear:PRINTTAB(3 ,20)" Press ESCAPE to SAVE readings to"T AB(3,21)" week ";w%;" OR any other ke y to enter"TAB(0,22)" readings for week ";w%+1:PROCting:A=GET:w%=w%+1:Y =Y-1:PROCclear 1050UNTIL FALSE 1060IF ERR=17 THEN PROCclear:PROCwait:P ROCpause 1070IF ERR<>17 THEN CLS:REPORT:PRINT" a t line ";ERL:STOP 1080CLOSE#F 1090PROCclear:PRINTTAB(3,20)CHR$141" Fi le GAS has been SAVED O.K."TAB(3,21)CHR$ 141" File GAS has been SAVED O.K.":PROCp ause:CLS:RUN 1100REM: ***** 1110CLS:PRINTTAB(0,0)" Week"TAB(10,0)" Reading"TAB(21,0)" Cubic Feet used"TAB(0 ,1)STRING$(40,"-")TAB(0,19)STRING$(40,"- ") 1120PRINTTAB(0,18)" Previous" 1130X=1:Y=17 1140PRINTTAB(3,Y);X:Y=Y-1:X=X+1 1150IF Y=8 THEN GOTO 1160 ELSE GOTO 114 0 1160X=10:Y=8 1170IF Y<9 THEN PRINTTAB(2,Y);X:Y=Y-1:X =X+1 1180IF Y=1 THEN GOTO 1190 ELSE GOTO1170 1190F=OPENIN("GAS") 1200w%=0:Y=18 1210REPEAT 1220INPUT#F,w%,normreadw%,normunitsw% 1230IF w%=0 THEN PRINTTAB(0,18)" Previo us":PROCnormunits:PROCnorre:PROCnorun 1240IF w%>0 AND w%<10 THEN PROCnormunit s:PRINTTAB(3,Y);w%;:PROCnorre:PROCnorun 1250IF w%>9 AND w%<18 THEN PROCnormunit s:PRINTTAB(2,Y);w%:PROCnorre:PROCnorun 1260w%=w%+1:Y=Y-1 1270UNTIL EOF#F 1280CLOSE#F 1290IF w%=0 THEN PROCclear:PRINTTAB(3,2 0)CHR$141CHR$132CHR$157CHR$135"Press any key for GAS Menu "CHR$156TAB(3,21)CHR$ 141CHR$132CHR$157CHR$135"Press any key f or GAS Menu "CHR$156:PROCting:A=GET:RUN 1300PRINTTAB(0,20)CHR$141CHR$132CHR$157 CHR$135"Press a key for Cost to week ";w %-1;" "CHR$156:PRINTTAB(0,21)CHR$141CHR $132CHR$157CHR$135"Press a key for Cost to week ";w%-1;" "CHR$156:A=GET 1310CLS:PRINTTAB(4,0)CHR$132CHR$157CHR$ 135CHR$141" COST OF GAS TO WEEK ";w%-1;" "CHR$156:PRINTTAB(4,1)CHR$132CHR$157 CHR$135CHR$141" COST OF GAS TO WEEK ";w% -1;" "CHR$156 1320PRINTTAB(0,3)" ==================== ==================" 1330Total1=normreadw%-normA 1340Total2=Total1*cubic 1350Total3=Total2*calorific 1360Total4=Total3/kilowatt 1370Total5=Total4*(1.520/100) 1380Total6=standingcharge 1390Total7=((Total5+Total6)/100)*8 1400Total8=(Total5+Total6+Total7) 1410PRINTTAB(0,4)CHR$141" ";INT(Total1) ;" cubic feet used":PRINTTAB(0,5)CHR$141 " ";INT(Total1);" cubic feet used" 1420@%=&020208:PRINTTAB(0,6)CHR$141;" = ";Total2;" cubic metres used"TAB(0,7)CH R$141;" = ";Total2;" cubic metres used": @%=&10 1430Total3=Total2*calorific 1440PRINTTAB(0,8)CHR$141" = ";INT(Total 4);" kilowatt hours used"TAB(0,9)CHR$141 " = ";INT(Total4);" kilowatt hours used" 1450PRINTTAB(0,10)" =================== ===================" 1460PRINTTAB(0,11)CHR$141;" ";INT(Total 4);" KWH at ";kilocost;"p.="TAB(27,11)"£ ";:PROCtot5 1470PRINTTAB(0,12)CHR$141;" ";INT(Total 4);" KWH at ";kilocost;"p.="TAB(27,12)"£ ";:PROCtot5 1480@%=&020208:PRINTTAB(0,13)CHR$141" P lus Standing Charge of":PRINTTAB(27,13)" £";:PROCtot6:@%=&10 1490@%=&020208:PRINTTAB(0,14)CHR$141" P lus Standing Charge of":PRINTTAB(27,14)" £";:PROCtot6:@%=&10 1500@%=&020208:PRINTTAB(0,15)CHR$141" P lus VAT at ";VAT;"% =";:PRINTTAB(27,15)" £":PROCtot7:@%=&10 1510@%=&020208:PRINTTAB(0,16)CHR$141" P lus VAT at ";VAT;"% =";:PRINTTAB(27,16)" £":PROCtot7:@%=&10 1520PRINTTAB(0,17)" =================== ===================" 1530PRINTTAB(0,18)CHR$141" Cost of gas to week ";w%-1;" =";:PRINTTAB(27,18)"£": PROCtot8:PRINTTAB(0,19)CHR$141" Cost of gas to week ";w%-1;" =";:PRINTTAB(27,19) "£":PROCtot8 1540PRINTTAB(0,20)" =================== ===================" 1550PRINTTAB(3,21)CHR$132CHR$157CHR$135 CHR$141"Press any key for GAS Menu "CH R$156TAB(3,22)CHR$132CHR$157CHR$135CHR$1 41"Press any key for GAS Menu "CHR$156 :A=GET:CHAIN "GasMenu" 1560REM: ***** 1570DEFPROCnorre 1580IF normreadw%<10 THEN PRINTTAB(16,Y );" ";normreadw%:ENDPROC 1590IF normreadw%>9 AND normreadw%<100 THEN PRINTTAB(15,Y);" ";normreadw%:ENDPR OC 1600IF normreadw%>99 AND normreadw%<100 0 THEN PRINTTAB(14,Y);" ";normreadw%:END PROC 1610IF normreadw%>999 AND normreadw%<10 000 THEN PRINTTAB(13,Y);" ";normreadw%:E NDPROC 1620IF normreadw%>9999 AND normreadw%<1 00000 THEN PRINTTAB(12,Y);" ";normreadw% :ENDPROC 1630REM: ***** 1640DEFPROCnorun 1650IF normunitsw%<10 THEN PRINTTAB(30, Y);" ";normunitsw%:ENDPROC 1660IF normunitsw%>9 AND normunitsw%<10 0 THEN PRINTTAB(29,Y);" ";normunitsw%:EN DPROC 1670IF normunitsw%>99 AND normunitsw%<1 000 THEN PRINTTAB(28,Y);" ";normunitsw%: ENDPROC 1680IF normunitsw%>999 AND normunitsw%< 10000 THEN PRINTTAB(27,Y);" ";normunitsw %:ENDPROC 1690IF normunitsw%>9999 AND normunitsw% <100000 THEN PRINTTAB(26,Y);" ";normunit sw%:ENDPROC 1700PRINT"Error In Entry. RUN The Progr am Again." 1710REM: ***** 1720DEFPROCnormunits 1730IF w%=0 THEN normA=normreadw%:normu nitsw%=0:ENDPROC 1740IF w%=1 THEN normB=normreadw%:normu nitsw%=normB-normA:ENDPROC 1750IF w%=2 THEN normC=normreadw%:normu nitsw%=normC-normB:ENDPROC 1760IF w%=3 THEN normD=normreadw%:normu nitsw%=normD-normC:ENDPROC 1770IF w%=4 THEN normE=normreadw%:normu nitsw%=normE-normD:ENDPROC 1780IF w%=5 THEN normF=normreadw%:normu nitsw%=normF-normE:ENDPROC 1790IF w%=6 THEN normG=normreadw%:normu nitsw%=normG-normF:ENDPROC 1800IF w%=7 THEN normH=normreadw%:normu nitsw%=normH-normG:ENDPROC 1810IF w%=8 THEN normI=normreadw%:normu nitsw%=normI-normH:ENDPROC 1820IF w%=9 THEN normJ=normreadw%:normu nitsw%=normJ-normI:ENDPROC 1830IF w%=10 THEN normK=normreadw%:norm unitsw%=normK-normJ:ENDPROC 1840IF w%=11 THEN normL=normreadw%:norm unitsw%=normL-normK:ENDPROC 1850IF w%=12 THEN normM=normreadw%:norm unitsw%=normM-normL:ENDPROC 1860IF w%=13 THEN normN=normreadw%:norm unitsw%=normN-normM:ENDPROC 1870IF w%=14 THEN normO=normreadw%:norm unitsw%=normO-normN:ENDPROC 1880IF w%=15 THEN normP=normreadw%:norm unitsw%=normP-normO:ENDPROC 1890IF w%=16 THEN normQ=normreadw%:norm unitsw%=normQ-normP:ENDPROC 1900REM: ***** 1910DEFPROCtitle:PRINTTAB(2,0)CHR$141CH R$132CHR$157CHR$135"GAS CONSUMPTION/COST PROGRAM "CHR$156TAB(2,1)CHR$141CHR$132 CHR$157CHR$135"GAS CONSUMPTION/COST PROG RAM "CHR$156:ENDPROC 1920REM: ***** 1930 1940 1950DEFPROCbasicinfo 1960 1970cubic=2.83: REM: (Cubic metres multiply figure) 1980 1990calorific=38.2:REM: (Calorific value figure) 2000 2010kilowatt=3.6: REM: (Kilowatt multiplier) 2020 2030kilocost=1.520:REM: (KWH cost in pence) 2040 2050standingcharge=9.45:REM: (10.39p per day x 91 days) 2060 2070VAT=8:REM: (per cent) 2080 2090REM: When you have altered or decided NOT to change any of these figures, press ANY KEY except ESCAPE to return to the GAS Menu 2100 2110ENDPROC 2120REM: ***** 2130DEFPROCbeep:SOUND 2,-15,100,1:FOR X =1 TO 250:NEXT X:SOUND 2,-15,100,1:ENDPR OC 2140REM: ***** 2150DEFPROCting:ENVELOPE1,1,0,0,0,0,0,0 ,126,-1,0,-1,126,0:SOUND1,1,150,5:ENDPRO C 2160REM: ***** 2170DEFPROCrasp 2180ENVELOPE1,1,4,5,0,255,255,0,127,-1, -1,-1,0,0 2190SOUND0,-15,3,10:SOUND1,1,80,10 2200ENDPROC 2210REM: ***** 2220DEFPROCclear:PRINTTAB(0,20)SPC(160) ;:ENDPROC 2230REM: ***** 2240DEFPROCpause:FOR X=1 TO 2000:NEXT X :ENDPROC 2250REM: ***** 2260DEFPROCwait:PRINTTAB(3,20)CHR$141" Please W A I T a few seconds"TAB(3,21) CHR$141" Please W A I T a few seconds" :PROCpause:ENDPROC 2270REM: ***** 2280DEFPROCtot5 2290IF INT Total5 <10 THEN @%=&020208:P RINTTAB(32,11)CHR$141" ";;Total5:PRINTTA B(32,12)CHR$141" ";;Total5:@%=&10:ENDPRO C 2300IF INT Total5>9 AND INT Total5<100 THEN @%=&020208:PRINTTAB(31,11)CHR$141" ";Total5:PRINTTAB(31,12)CHR$141" ";Total 5:@%=&10:ENDPROC 2310IF INT Total5>99 AND INT Total5<100 0 THEN @%=&020208:PRINTTAB(30,11)CHR$141 " ";Total5:PRINTTAB(30,12)CHR$141" ";Tot al5:@%=&10:ENDPROC 2320IF INT Total5>999 AND INT Total5<10 000 THEN @%=&020208:PRINTTAB(29,11)CHR$1 41" ";Total5:PRINTTAB(29,12)CHR$141" ";T otal5:@%=&10:ENDPROC 2330REM: ***** 2340DEFPROCtot6 2350IF INT Total6 <10 THEN @%=&020208:P RINTTAB(32,13)CHR$141" ";Total6:PRINTTAB (32,14)CHR$141" ";Total6:@%=&10:ENDPROC 2360IF INT Total6>9 AND INT Total6<100 THEN @%=&020208:PRINTTAB(31,13)CHR$141" ";Total6:PRINTTAB(31,14)CHR$141" ";Total 6:@%=&10:ENDPROC 2370IF INT Total6>99 AND INT Total6<100 0 THEN @%=&020208:PRINTTAB(30,13)CHR$141 " ";Total6:PRINTTAB(30,14)CHR$141" ";Tot al6:@%=&10:ENDPROC 2380IF INT Total6>999 AND INT Total6<10 000 THEN @%=&020208:PRINTTAB(29,13)CHR$1 41" ";Total6:PRINTTAB(29,14)CHR$141" ";T otal6:@%=&10:ENDPROC 2390REM: ***** 2400DEFPROCtot7 2410IF INT Total7 <10 THEN @%=&020208:P RINTTAB(32,15)CHR$141" ";Total7:PRINTTAB (32,16)CHR$141" ";Total7:@%=&10:ENDPROC 2420IF INT Total7 >9 AND INT Total7<100 THEN @%=&020208:PRINTTAB(31,15)CHR$141" ";Total7:PRINTTAB(31,16)CHR$141" ";Tota l7:@%=&10:ENDPROC 2430IF INT Total7 >99 AND INT Total7<10 00 THEN @%=&020208:PRINTTAB(30,15)CHR$14 1" ";Total7:PRINTTAB(30,16)CHR$141" ";To tal7:@%=&10:ENDPROC 2440REM: ***** 2450DEFPROCtot8 2460IF INT Total8 <10 THEN @%=&020208:P RINTTAB(32,18)CHR$141" ";Total8:PRINTTAB (32,19)CHR$141" ";Total8:@%=&10:ENDPROC 2470IF INT Total8 >9 AND INT Total8<100 THEN @%=&020208:PRINTTAB(31,18)CHR$141" ";Total8:PRINTTAB(31,19)CHR$141" ";Tota l8:@%=&10:ENDPROC 2480IF INT Total8>99 AND INT Total8<100 0 THEN @%=&020208:PRINTTAB(30,18)CHR$141 " ";Total8:PRINTTAB(30,19)CHR$141" ";Tot al8:@%=&10:ENDPROC 2490IF INT Total8>999 AND INT Total8<10 000 THEN @%=&020208:PRINTTAB(29,18)CHR$1 41" ";Total8:PRINTTAB(29,19)CHR$141" ";T otal8:@%=&10:ENDPROC 2500REM: ***** 2510END