8-Bit Software Online Conversion
Formatted Program Listings - Listing
10*|"
20*|" Formatted Program Lister
30*|"
40*|" A program to display a
50*|" BASIC file neatly on
60*|" screen or to printer
70*|"
80*|" Written by Alex Savvides
90*|" For 8-Bit Public Domain
100*|"
110:
120IFPAGE<>&1900THENPRINT'" Set PAGE t
o &1900 and re-load":END
130:
140MODE7:VDU23;8202;0;0;0;
150*FX4 2
160*FX11
170CLOSE#0
180DIMfile$(31)
190FORK=1TO2
200PRINTTAB(0,K);" ";CHR$157;CHR$141"
Formatted Program Lister"
210NEXT
220PRINT'SPC(7);" Written by Alex Savv
ides"
230PRINTTAB(0,24);" ";CHR$157;" An
8-Bit Public Domain Utility";
240VDU28,1,22,39,6
250ONERRORPROCerror
260CLS
270PROCask
280PROCconfigure
290CLS
300IFprinterTHENVDU2
310inv=0
320nl=FALSE
330X=OPENIN(file$)
340IFX=0THENVDU7:PRINT" Not there!"':C
LOSE#0:GOTO480
350REPEAT
360A=BGET#(X)
370IFnl=TRUEANDA=32THENnl=FALSE:GOTO44
0
380IFA>&80THENPROCcode(A):PRINT;str$;:
GOTO430
390IFA=&0DTHENPROCline:GOTO430ELSEIFA<
32ORA>128THENGOTO430
400IFA=ASC(":")THENPRINT'TAB(6);": ";:
GOTO430
410IFA=34THENinv=invEOR1
420VDUA
430IFA=&E5THENPROCgoto
440UNTILEOF#X
450CLOSE#X
460*FX202 32
470PRINT''" End of file"
480PRINT" Another program?";
490REPEAT:A$=GET$:UNTILINSTR("YyNn",A$
)
500IFA$="Y"ORA$="y"THENGOTO260
510CALL!-4
520:
530DEFPROCcode(C)
540IFinv=1THENstr$=CHR$(C):ENDPROC
550pointer=&8071
560found=FALSE
570str$=""
580end=FALSE
590A%=C
600CALLptoken
610ENDPROC
620:
630DEFPROCline
640A=BGET#(X)
650IFEOF#XTHENENDPROC
660line=A*256
670A=BGET#(X)
680IFEOF#XTHENENDPROC
690line=line+A
700A=BGET#(X)
710PRINT'line;" ";
720nl=TRUE
730ENDPROC
740:
750DEFPROCconfigure
760@%=&00000005
770bs$=LEFT$($&8009,5)
780IFbs$<>"BASIC"THENPRINT'"Basic Rom
not paged in.":END
790IF?&8015=ASC("2")THENbasic=2:ptoken
=&B50EELSEbasic=1:ptoken=&B53A
800ENDPROC
810:
820DEFPROCask
830PRINTTAB(0,0);
840*CAT
850PRINT'" Enter Filename :";
860INPUT""file$
870PRINT" Does the printer want a copy
?";
880REPEAT
890G$=GET$
900UNTILINSTR("YN",G$)
910IFG$="Y"THENprinter=TRUEELSEprinter
=FALSE
920ENDPROC
930:
940DEFPROCerror
950CLOSE#0
960VDU3,7,12
970IFERR=17THENENDPROC
980PRINT" An error has occured:"
990REPORT:PRINT" at line ";ERL'
1000PRINT" Press a key...":*FX21
1010key=GET
1020ENDPROC
1030:
1040DEFPROCgoto
1050A=BGET#(X)
1060IFA=32THENVDU32:GOTO1050
1070C1=A
1080A=BGET#(X)
1090C2=A
1100A=BGET#(X)
1110C3=A
1120A=BGET#(X)
1130C4=A
1140goto=(C4AND&3F)*&100+(C3AND&3F)
1150IF(C2AND4)=0THENgoto=goto+&4000
1160IF(C2AND16)=0THENgoto=goto+&40
1170IF(C2AND32)=32THENgoto=goto+&80
1180PRINT;goto;
1190ENDPROC