8-Bit Software Online Conversion
Presenting programs Ex. 3 - Listing
10REM >Step3
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%)
440REPEAT
450*FX21
460key%=GET
470PROCdraw`bar(choice%)
480IF key%=138 THEN IF choice%<5 THEN
choice%=choice%+1
490IF key%=139 THEN IF choice%>0 THEN
choice%=choice%-1
500PROCdraw`bar(choice%)
510UNTIL key%=13
520=choice%
530:
540DEF PROCdraw`bar(choice%)
550LOCAL y%
560GCOL 4,1
570FOR y%=1020-((choice%+4)*32) TO (10
20-((choice%+4)*32)-28) STEP -4
580MOVE 0,y%
590DRAW 1276,y%
600NEXT
610ENDPROC
620:
630DEF PROCtitle
640VDU 26,12
650COLOUR 0:COLOUR 129
660PROCdouble`height(" Menu demonstrat
ion ",10,0)
670COLOUR 1:COLOUR 128
680PRINTTAB(8,2);"(C) Steven Flintham
1993"
690ENDPROC
700:
710DEF PROCdouble`height(text$,x%,y%)
720LOCAL pos%,A%,X%,Y%
730VDU 31,x%,y%
740FOR pos%=1 TO LEN(text$)
750block%?0=ASC(MID$(text$,pos%,1))
760A%=10
770X%=block% MOD 256
780Y%=block% DIV 256
790CALL &FFF1
800VDU 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
810REM 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
820NEXT
830ENDPROC