8-Bit Software Online Conversion
8BS Menu Reader - Listing
10REM > MenRead 1.22
20REM v1.20 19-06-96 JGH: Modified fo
r new menus
30REM v1.21 23-11-96 JGH: Output to f
ile added
40REM v1.22 12-07-98 JGH: More menu f
unctions added
50:
60DEFFNS="MenRead"
70MODE7
80Uon$=CHR$1+CHR$27+CHR$1+CHR$45+CHR$
1+CHR$1
90Uoff$=CHR$1+CHR$27+CHR$1+CHR$45+CHR
$1+CHR$0
100REPEAT
110MODE7:VDU23;8202;0;0;0;23;2,53;0;0;
0;0;0;
120PRINT'''TAB(4)"
130PRINTTAB(4)"
140PRINT'''" Printout of menu from iss
ue 28 onwards."
150PRINT" Including new menu from is
sue 50"
160PRINT'''TAB(8)" Printer on? Y/N
"
170REPEAT:A$=GET$:UNTILINSTR("YyNn",A$
)
180IF INSTR("Yy",A$):P%=2 ELSE P%=14
190in%=0:out%=0:A%=0:E%=0:Y%=0:fs%=(US
R&FFDA)AND&FF
200IFfs%=4:OSCLI"DRIVE 0":OSCLI"DIR $"
ELSE IFfs%<>5:OSCLI"MOUNT 0"
210PRINT'TAB(6)" Output to file? Y/N
"
220REPEAT:A$=GET$:UNTILINSTR("YyNn",A$
)
230IF INSTR("Yy",A$):INPUT'TAB(6)" Out
put filename: "F$:out%=OPENOUT(F$):P%=0
240MODE&80:ONERROR:REPORT:PROCClose:PR
INT:END
250T%=0:in%=OPENIN"Menu":IFin%:IFEXT#i
n%<&1800:CLOSE#in%:in%=0
260IFin%=0:T%=1:in%=OPENIN"!Boot":PTR#
in%=EXT#in%DIV2
270Issue$=FNissue:Date$=FNdate
280VDUP%:IF P%=14 PRINT"Press SHIFT to
scroll text."
290A%=FNfx(199,out%):PRINTTAB(8);:IFP%
=2:PRINTUon$;
300PRINT "8-Bit Software Issue ";Issue
$;" (";Date$;") ";MID$("HA",3-fs%DIV8);"
DFS Version";FNcr;:IFP%=2:PRINTUoff$;
310PRINTTAB(5);:IFP%=2:PRINTUon$;
320PRINT"Program description.
Type. Program name."FNcr;
330IFP%=2:PRINTUoff$;
340IFT%=0:PTR#in%=&1300
350REPEAT:PROCmenu:REPEATUNTILBGET#in%
=&D OR EOF#in%
360UNTILEOF#in%:CLOSE#in%:in%=0:IFP%=2
:VDU3
370IFout%:CLOSE#out%:out%=0:A%=FNfx(19
9,0)
380PRINT'''"Insert next disk and press
a key, or Escape to end";:IFGET
390UNTILFALSE:END
400:
410DEFPROCmenu:REPEATUNTILBGET#in%=&DC
OREOF#in%:REM Find DATA statement
420IFEOF#in%:ENDPROC
430MenTit$=FNgt:Num%=VALFNgt:IFP%=2:PR
INTUon$;
440PRINTFNcr;MenTit$;FNcr;:IFP%=2:PRIN
TUoff$;
450FORL%=1TO Num%:PTR#in%=PTR#in%+5:RE
M Move to next line
460Desc$=FNgt:IFT%=0:Act$=FNgt
470Dir$=FNgt:Name$=FNgt:Asc$=FNgt:IFT%
=0:Ttx$=FNgt:Opt%=VALFNgt
480IFDir$<>"":Dir$=Dir$+"."
490IFT%=0:Opt%=VALAsc$+VALTtx$
500IFT%=1:Opt%=VALAsc$:IFOpt%=0:Opt%=-
1-INSTR("MODE3TEXT MODE7TTXT ARCHIARCHIC
HAINBASICLOAD LOAD LIST LIST ",LEFT$(Asc
$,5))DIV10
510IFOpt%>0:NEXT:ENDPROC
520PRINTTAB(5)CHR$(L%+64);": ";Desc$;T
AB(38);MID$("Prog Text Ttxt Arch BasicBa
sicBasic",1-5*Opt%,5);
530PRINTTAB(45);Dir$;Name$;FNcr;
540NEXT:ENDPROC
550:
560DEFFNgt:A$="":REPEATA%=BGET#in%
570IFA%<>&2C AND A%<>&D AND A%>31 AND
A%<127:A$=A$+CHR$A%
580UNTILA%=&2C OR A%=&D:IFLEFT$(A$,1)=
" ":REPEATA$=MID$(A$,2):UNTILLEFT$(A$,1)
<>" "
590=LEFT$(A$,LENA$+(RIGHT$(A$,1)="""")
)
600DEFFNissue:L%=0:REPEAT:IFBGET#in%=&
6C:IFBGET#in%=&24:IFBGET#in%=&3D:IFBGET#
in%=&22:L%=TRUE
610UNTILL% OR T%>0:IFT%=1:REPEATREPEAT
UNTILBGET#in%=&D:PTR#in%=PTR#in%+3:UNTIL
BGET#in%=&DC
620=FNgt
630DEFFNdate:L%=0:REPEAT:IFBGET#in%=&6
D:IFBGET#in%=&24:IFBGET#in%=&3D:IFBGET#i
n%=&22:L%=TRUE
640UNTILL% OR T%>0:IFT%=1:PTR#in%=PTR#
in%-1
650DEFFNcr:PRINTCHR$13;:A%=FNfx(199,0)
:PRINT:A%=FNfx(199,out%):=""
660=FNgt
670DEFFNfx(A%,X%):LOCALY%:Y%=X%DIV256:
=((USR&FFF4)AND&FFFF00)DIV256
680DEFPROCClose:IFout%:A%=out%:out%=0:
CLOSE#A%
690IFin%:A%=in%:in%=0:CLOSE#A%
700ENDPROC