8-Bit Software Online Conversion
Presenting progs Ex. 3 - Listing
10REM >SD3
20REM by Steven Flintham
30REM
40REM Wednesday 12th May 1993
50:
60MODE 4
70VDU 23;8202;0;0;0;
80PROCdisable
90PROCinit
100REPEAT
110choice%=FNmenu
120UNTIL choice%=6
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";TAB(36,4);
"1"
360PRINTTAB(3,5);"Option 2";TAB(36,5);
"2"
370PRINTTAB(3,6);"Option 3"
380PRINTTAB(3,7);"Option 4";TAB(36,7);
"4"
390PRINTTAB(3,8);"Option 5"
400PRINTTAB(3,9);"Quit this program";T
AB(36,9);"Q"
410PRINTTAB(0,11);"Use the cursor keys
to move the bar and"'"press RETURN to s
elect"
420choice%=1
430PROCdraw`bar(choice%,TRUE,0)
440REPEAT
450REPEAT
460*FX21
470key%=GET
480UNTIL key%=138 OR key%=139 OR key%=
13 OR INSTR("124Qq",CHR$(key%))<>0
490IF key%=138 THEN IF choice%<6 THEN
choice%=choice%+1:PROCdraw`bar(choice%,T
RUE,32)
500IF key%=139 THEN IF choice%>1 THEN
choice%=choice%-1:PROCdraw`bar(choice%,F
ALSE,-32)
510IF key%>=ASC("a") AND key%<=ASC("z"
) THEN key%=key%-32
520IF key%=ASC("1") THEN PROCdraw`bar(
choice%,TRUE,0):choice%=1:PROCdraw`bar(c
hoice%,TRUE,0)
530IF key%=ASC("2") THEN PROCdraw`bar(
choice%,TRUE,0):choice%=2:PROCdraw`bar(c
hoice%,TRUE,0)
540IF key%=ASC("4") THEN PROCdraw`bar(
choice%,TRUE,0):choice%=4:PROCdraw`bar(c
hoice%,TRUE,0)
550IF key%=ASC("Q") THEN PROCdraw`bar(
choice%,TRUE,0):choice%=6:PROCdraw`bar(c
hoice%,TRUE,0)
560UNTIL key%=13
570=choice%
580:
590DEF PROCdraw`bar(choice%,top`to`bot
tom%,offset%)
600LOCAL start%,end%,temp%,y%
610GCOL 4,1
620start%=1020-((choice%+3)*32)
630end%=(1020-((choice%+3)*32)-28)
640IF NOT top`to`bottom% THEN temp%=st
art%:start%=end%:end%=temp%
650FOR y%=start% TO end% STEP SGN(end%
-start%)*4
660MOVE 0,y%
670DRAW 1276,y%
680IF offset%<>0 THEN MOVE 0,y%+offset
%:DRAW 1276,y%+offset%:PROCdelay(2)
690NEXT
700ENDPROC
710:
720DEF PROCdelay(delay%)
730LOCAL time%
740time%=TIME
750REPEAT UNTIL TIME-time%>=delay%
760ENDPROC
770:
780DEF PROCtitle
790VDU 26,12
800COLOUR 0:COLOUR 129
810PROCdouble`height(" Menu demonstrat
ion ",10,0)
820COLOUR 1:COLOUR 128
830PRINTTAB(8,2);"(C) Steven Flintham
1993"
840ENDPROC
850:
860DEF PROCdouble`height(text$,x%,y%)
870LOCAL pos%,A%,X%,Y%
880VDU 31,x%,y%
890FOR pos%=1 TO LEN(text$)
900block%?0=ASC(MID$(text$,pos%,1))
910A%=10
920X%=block% MOD 256
930Y%=block% DIV 256
940CALL &FFF1
950VDU 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
960REM 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
970NEXT
980ENDPROC