8-Bit Software Online Conversion

Lottery Data Editor - Listing

10DEFFNS="UltAlt" 20*FX 200,1 30ONERROR VDU3:OSCLI"FX 200":REPORT:P RINTERL:END 40MODE7 50VDU23;8202;0;0;0; 60REPEAT 70CLS 80PRINTTAB(4)"    90PRINTTAB(4)"    100PRINT'TAB(12)"     120PRINT'TAB(8)" By C.J.Richardson "'' 130PRINTTAB(9)" 1. Info" 140PRINTTAB(9)" 2. View/Print Data" 150PRINTTAB(9)" 3. Edit Data" 160PRINTTAB(9)" 4. Insert Missed Week" 170PRINTTAB(9)" 5. Delete A Week" 180PRINTTAB(9)" *. Command" 190PRINT'TAB(9)" 0. End" 200PRINT'TAB(8)" Enter 0 - 5 or * " 210REPEAT 220B$=GET$ 230UNTILINSTR("012345*",B$) 240IF B$="1"PROCinfo 250IF B$="2"PROCprintout 260IF B$="3"PROCget("Edit"):IF INSTR(" Yy",A$)PROCedit 270IF B$="4"PROCget("Insert"):IF INSTR ("Yy",A$)PROCinsert:PROCedit 280IF B$="5"PROCget("Delete"):IF INSTR ("Yy",A$)PROCremove 290IF B$="*":CLS:INPUT''" *"B$:PRINT ':OSCLIB$:PRINT''TAB(10)" PRESS A KEY ":OSCLI"FX21":REPEATUNTILGET 300UNTILB$="0" 310*FX200 320END 330DEFPROCprintout 340F%=OPENIN"UltDat" 350CLS:PRINT'"To Printer Y/N?"' 360*FX21 370REPEAT 380A$=GET$ 390UNTILINSTR("YyNn",A$) 400IF INSTR("Yy",A$) VDU2 ELSE PRINT"P ress SHIFT To Scroll Numbers"':VDU14 410A%=1 420REPEAT 430PRINT"Week ";STR$(A%);TAB(9); 440FORL%=1 TO 6 450B%=BGET#F% 460PRINTSTRING$(2-LEN(STR$(B%)),"0")+S TR$(B%);:IF L%<>6PRINT","; 470NEXT 480B%=BGET#F% 490PRINTTAB(28)" Bonus ";STRING$(2-LEN (STR$(B%)),"0")+STR$(B%) 500A%=A%+1 510UNTILEOF#F% 520CLOSE#F% 530VDU3,15 540*FX21 550PRINT'"Press A Key" 560REPEATUNTILGET 570ENDPROC 580DEFPROCinfo 590CLS 600PRINT'" Lottery Program Data Ed itor "' 610VDU14 620PRINT" This program will edit the d ata" 630PRINT" produced by the 'Ultimate Lo ttery" 640PRINT" Program' by C.J.Richardson" 650PRINT 660PRINT" It is VERY important that yo u copy the" 670PRINT" data 'UltDat' to a blank dis c before" 680PRINT" editing it with this program ." 690PRINT 700PRINT" You can edit a week, insert a week or" 710PRINT" remove a week. When removing a week," 720PRINT" the program needs to make a copy of" 730PRINT" the data. It is therefore ve ry" 740PRINT" important to ensure that the disc you" 750PRINT" are using is no more than ha lf full" 760PRINT" before you start." 770PRINT 780VDU15 790PRINTTAB(10)" Press a key " 800*FX21 810REPEATUNTILGET 820ENDPROC 830DEFPROCget(P$) 840F%=OPENUP"UltDat" 850REPEAT 860REPEAT 870CLS 880PRINT'TAB(10)"       900PRINTTAB(3)" Enter week to ";P$;" : 1 - ";EXT#F%/7;" "'' 910INPUT" ";A% 920UNTILA%>0 AND A%<=EXT#F%/7 930A%=A%-1 940PRINTTAB(0,8);SPC(5) 950PTR#F%=(A%)*7 960PRINT''" Week ";STR$(A%+1);": "; 970FORL%=1 TO 6 980PRINTRIGHT$("0"+STR$(BGET#F%),2);" "; 990NEXT 1000PRINT" Bonus: ";RIGHT$("0"+STR$(BGE T#F%),2) 1010IF P$="Insert" Q$=" before" ELSE Q$ ="" 1020PRINT''''TAB(3)" ";P$;Q$;" this, sure Y/N/Q? " 1030REPEAT 1040*FX21 1050A$=GET$ 1060UNTILINSTR("YyNnQq",A$) 1070UNTILINSTR("YyQq",A$) 1080CLOSE#F% 1090ENDPROC 1100DEFPROCedit 1110F%=OPENUP"UltDat" 1120REPEAT 1130PTR#F%=A%*7 1140FORL%=1 TO 7 1150REPEAT 1160PRINTTAB(0,16)SPC(38) 1170PRINTTAB(0,16)" Enter "; 1180IF L%=7 PRINT"Bonus "; 1190PRINT"Number ";STR$(L%);":"; 1200INPUT" "B% 1210UNTILB%>0 AND B%<50 1220BPUT#F%,B% 1230NEXT 1240PRINTTAB(0,11)" Week ";STR$(A%+1);" : "; 1250PTR#F%=A%*7 1260FORL%=1 TO 6 1270PRINTRIGHT$("0"+STR$(BGET#F%),2);" "; 1280NEXT 1290PRINT" Bonus: ";RIGHT$("0"+STR$(BGE T#F%),2) 1300PRINTTAB(0,16)SPC(38) 1310PRINTTAB(0,16)" Is this ok? Y/N" 1320REPEAT 1330C$=GET$ 1340UNTILINSTR("YyNn",C$) 1350UNTILINSTR("Yy",C$) 1360CLOSE#F% 1370ENDPROC 1380DEFPROCinsert 1390PRINT''TAB(12)" Inserting " 1400F%=OPENUP"UltDat" 1410PTR#F%=EXT#F% 1420N%=A%*7 1430FORL%=1TO7 1440BPUT#F%,0 1450NEXT 1460O%=EXT#F%-1 1470REPEAT 1480PTR#F%=O%-7 1490B%=BGET#F% 1500PTR#F%=O% 1510BPUT#F%,B% 1520O%=O%-1 1530UNTILO%=N%+6 1540PTR#F%=N% 1550FORL%=1TO7 1560BPUT#F%,0 1570NEXT 1580CLOSE#F% 1590PRINTTAB(0,11)" Week ";STR$(A%+1);" : 00 00 00 00 00 00 Bonus: 00" 1600ENDPROC 1610DEFPROCremove 1620PRINT''TAB(8)" Removing a week " 1630F%=OPENUP"UltDat" 1640N%=A%*7 1650IF N%+7<>EXT#F%:REPEAT:PTR#F%=N%+7: B%=BGET#F%:PTR#F%=N%:BPUT#F%,B%:N%=N%+1: UNTILN%=EXT#F%-7 ELSE PTR#F%=N% 1660FORL%=1TO7 1670BPUT#F%,0 1680NEXT 1690CLOSE#F% 1700PROCzero 1710ENDPROC 1720DEFPROCzero 1730F%=OPENIN"UltDat" 1740G%=OPENOUT"Temp" 1750PTR#F%=EXT#F%-1 1760IFBGET#F%<>0:CLOSE#F%:CLOSE#G%:ENDP ROC 1770REPEAT 1780PTR#F%=PTR#F%-2 1790UNTILBGET#F%<>0 1800T%=PTR#F% 1810PTR#F%=0 1820REPEAT 1830BPUT#G%,BGET#F% 1840UNTILPTR#F%=T% 1850CLOSE#F% 1860CLOSE#G% 1870*DELETE UltDat 1880*RENAME Temp UltDat 1890REM I didn't use EXT#F% because it is Master only! 1900ENDPROC