8-Bit Software Online Conversion

Presenting programs Ex. 4 - Listing

10REM >Step4 20REM by Steven Flintham 30REM 40REM Sunday 4th April 1993 50: 60MODE 4 70VDU 23;8202;0;0;0; 80PROCdisable 90PROCinit 100REPEAT 110choice%=FNmenu 120UNTIL choice%=5 130MODE 7 140PROCenable 150END 160: 170DEF PROCdisable 180*FX229,1 190*FX4,1 200ENDPROC 210: 220DEF PROCenable 230*FX229 240*FX4 250ENDPROC 260: 270DEF PROCinit 280ON ERROR MODE 7:REPORT:PRINT " at l ine ";ERL:PROCenable:END 290DIM block% 8 300ENDPROC 310: 320DEF FNmenu 330LOCAL choice%,key% 340PROCtitle 350PRINTTAB(3,4);"Option 1" 360PRINTTAB(3,5);"Option 2" 370PRINTTAB(3,6);"Option 3" 380PRINTTAB(3,7);"Option 4" 390PRINTTAB(3,8);"Option 5" 400PRINTTAB(3,9);"Quit this program" 410PRINTTAB(0,11);"Use the cursor keys to move the bar and"'"press RETURN to s elect" 420choice%=0 430PROCdraw`bar(choice%,TRUE,0) 440REPEAT 450*FX21 460key%=GET 470IF key%=138 THEN IF choice%<5 THEN choice%=choice%+1:PROCdraw`bar(choice%,T RUE,32) 480IF key%=139 THEN IF choice%>0 THEN choice%=choice%-1:PROCdraw`bar(choice%,F ALSE,-32) 490UNTIL key%=13 500=choice% 510: 520DEF PROCdraw`bar(choice%,top`to`bot tom%,offset%) 530LOCAL start%,end%,temp%,y% 540GCOL 4,1 550start%=1020-((choice%+4)*32) 560end%=(1020-((choice%+4)*32)-28) 570IF NOT top`to`bottom% THEN temp%=st art%:start%=end%:end%=temp% 580FOR y%=start% TO end% STEP SGN(end% -start%)*4 590MOVE 0,y% 600DRAW 1276,y% 610IF offset%<>0 THEN MOVE 0,y%+offset %:DRAW 1276,y%+offset% 620PROCdelay(2) 630NEXT 640ENDPROC 650: 660DEF PROCdelay(delay%) 670LOCAL time% 680time%=TIME 690REPEAT UNTIL TIME-time%>=delay% 700ENDPROC 710: 720DEF PROCtitle 730VDU 26,12 740COLOUR 0:COLOUR 129 750PROCdouble`height(" Menu demonstrat ion ",10,0) 760COLOUR 1:COLOUR 128 770PRINTTAB(8,2);"(C) Steven Flintham 1993" 780ENDPROC 790: 800DEF PROCdouble`height(text$,x%,y%) 810LOCAL pos%,A%,X%,Y% 820VDU 31,x%,y% 830FOR pos%=1 TO LEN(text$) 840block%?0=ASC(MID$(text$,pos%,1)) 850A%=10 860X%=block% MOD 256 870Y%=block% DIV 256 880CALL &FFF1 890VDU 23,255,0,block%?1,block%?1,bloc k%?2,block%?2,block%?3,block%?3,block%?4 ,255,8,10,23,255,block%?4,block%?5,block %?5,block%?6,block%?6,block%?7,block%?7, block%?8,255,11 900REM VDU 23,255,block%?1,block%?1,bl ock%?2,block%?2,block%?3,block%?3,block% ?4,block%?4,255,8,10,23,255,block%?5,blo ck%?5,block%?6,block%?6,block%?7,block%? 7,block%?8,block%?8,255,11 910NEXT 920ENDPROC