home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
CATLOG
/
PRINTLST.LBR
/
PRINTLST.BQS
/
PRINTLST.BAS
Wrap
BASIC Source File
|
2000-06-30
|
8KB
|
380 lines
REM -------------[ PRINTLST.BAS (Prints MAST.LST files) ]-----------------\
\
Program written and (C) 1984 by Steven L. Sanders\
\
Date written - November 24, 1984\
\
Version 1, revision 2 (generic version)\
\
Language - CBASIC Compiler (CB80)\
\
This program will output the contents of the MAST.LST file\
generated by XCATxx.COM into a 3-across format either to the\
CRT, printer, or diskfile. I found all the other listing programs\
to be big space-wasters when it came to the number of sheets\
needed to print-out a big catalog. PRINTLST ignores all other\
disk numbers except for the first one generated by XCAT, if you\
need a cross-ref listing then use XCAT's list output function.\
\
To use, run XCATxx on your MAST.CAT file first and choose the\
diskfile output option and generate the needed MAST.LST file.\
PRINTLST will look for MAST.LST on the logged du:, read it in\
and then generate the 3-across format to CRT, printer, or disk.\
\
----------------------------[ (C)opyrights ]---------------------------------\
copyright1$ =\
"Portions of this program (C)1983, 1984 by Digital Research "
copyright2$ =\
" The rest is (C) 1984 by Steven L. Sanders"
REM ------------------------[ DEFINE CONSTANTS ]-----------------------------\
false% = 0 REM true and false used for
true% = NOT false% REM while/wend loops
bell$ = CHR$(07h) REM console bell
cr$ = CHR$(0dh) REM carriage return
formfeed$ = CHR$(0ch) REM printer formfeed
file.mast$ = "mast.lst" REM source MAST.LST
sep$ = " | " REM file seperator
fil.sep$ = " | " REM output file seperator
REM -------------------[ program code begins ]--------------------------\
begin:
ON ERROR GOTO error.handler
FOR scroll% = 1 TO 24 : PRINT : NEXT scroll%
PRINT\
" PRINTLST v1.2 - Prints the MAST.LST file (C)1984 Steven L. Sanders"
PRINT\
" ==================================================================="
PRINT:PRINT:PRINT\
" Output to: <P>rinter, <C>RT, or <D>iskfile? (P, C, or D): ";
well:
PRINT bell$;
answer% = INKEY
IF UCASE$(CHR$(answer%)) = "P" THEN\
PRINT "Printer":\
GOTO list.it
IF UCASE$(CHR$(answer%)) = "D" THEN\
PRINT "Diskfile":\
GOTO create.it
IF UCASE$(CHR$(answer%)) <> "C" THEN GOTO well
PRINT "CRT"
REM -----------------------[ output to crt ]----------------------------------\
IF NOT SIZE(file.mast$) THEN \
PRINT:PRINT:PRINT "Unable to open MAST.LST on current du:" + bell$:\
STOP \
ELSE \
OPEN file.mast$ AS 1
IF END #1 THEN thats.all
count% = 1
line% = 1
new.head:
PRINT:PRINT\
"filename.typ - dsk | filename.typ - dsk | filename.typ - dsk"
PRINT\
"----------------------------------------------------------------------"
WHILE true%
do.it:
IF count% > 3 THEN\
count% = 1:\
PRINT
READ #1;LINE input.line$
IF MID$(input.line$,4,5) = "DONE:" THEN\
PRINT input.line$:\
GOTO do.it
IF LEFT$(input.line$,9) = " " THEN\
PRINT input.line$:\
GOTO thats.all
PRINT LEFT$(input.line$,20);
IF count% = 1 OR count% = 2 THEN \
PRINT sep$;
line% = line% + 1
count% = count% + 1
IF line% <= 60 THEN GOTO do.it
line% = 1
PRINT:PRINT "[ any key or <Q>uit ]";
go.or.no:
dummy% = INKEY
IF UCASE$(CHR$(dummy%)) = "Q" THEN\
PRINT cr$;" ";cr$;:\
CLOSE 1:\
STOP\
ELSE\
GOTO new.head
WEND
thats.all:
PRINT
PRINT "All done." + bell$
STOP
REM ------------------------[ output to printer ]----------------------------\
list.it:
IF NOT SIZE(file.mast$) THEN \
PRINT:PRINT:PRINT "Unable to open MAST.LST on current du:" + bell$:\
STOP \
ELSE \
OPEN file.mast$ AS 1
enter.date:
PRINT bell$:INPUT\
" Enter today's date (MM/DD/YY): ";LINE todays.date$
IF LEN(todays.date$) <> 8 THEN GOTO enter.date
PRINT:PRINT:PRINT\
" ++ Outputting MAST.LST to the printer ++";
IF END #1 THEN all.printed
count% = 1
line% = 1
page% = 1
LPRINTER WIDTH 80
new.page:
PRINT\
"MAST.LST - Master CP/M Catalog as of " + todays.date$ + \
" page";page%
PRINT:PRINT\
"filename.typ - dsk | filename.typ - dsk | filename.typ - dsk"
PRINT\
"----------------------------------------------------------------------"
IF page% = 1 THEN PRINT
WHILE true%
doing.it:
IF count% > 3 THEN\
count% = 1:\
PRINT
READ #1;LINE input.line$
IF MID$(input.line$,4,5) = "DONE:" THEN\
PRINT input.line$:\
GOTO doing.it
IF LEFT$(input.line$,9) = " " THEN\
PRINT input.line$:\
GOTO all.printed
PRINT LEFT$(input.line$,20);
IF count% = 1 OR count% = 2 THEN \
PRINT sep$;
line% = line% + 1
count% = count% + 1
IF line% <= 171 THEN GOTO doing.it
line% = 1
PRINT formfeed$
page% = page% + 1
GOTO new.page
WEND
all.printed:
CONSOLE
CLOSE 1
PRINT:PRINT "All done." + bell$
STOP
REM ------------------------[ output to diskfile ]----------------------------\
create.it:
IF NOT SIZE(file.mast$) THEN \
PRINT:PRINT:PRINT "Unable to open MAST.LST on current du:" + bell$:\
STOP \
ELSE \
OPEN file.mast$ AS 1
enter.the.date:
PRINT
PRINT bell$:INPUT\
" Enter today's date (MM/DD/YY): ";LINE todays.date$
IF LEN(todays.date$) <> 8 THEN GOTO enter.the.date
PRINT:PRINT:PRINT\
"Enter drive to create MASTER.LST on (A,B,C,or c/r for default): ";
which.drive:
PRINT bell$;
answer% = INKEY
IF answer% = 0dh THEN\
PRINT "Default":\
file.form$ = "MASTER.LST":\
GOTO get.on.with.it
IF UCASE$(CHR$(answer%)) = "A" THEN\
PRINT "A":\
file.form$ = "A:MASTER.LST":\
GOTO get.on.with.it
IF UCASE$(CHR$(answer%)) = "B" THEN\
PRINT "B":\
file.form$ = "B:MASTER.LST":\
GOTO get.on.with.it
IF UCASE$(CHR$(answer%)) = "C" THEN\
PRINT "C":\
file.form$ = "C:MASTER.LST":\
GOTO get.on.with.it
GOTO which.drive
get.on.with.it:
IF SIZE(file.form$) THEN\
PRINT:PRINT:PRINT:PRINT bell$ +\
" Program ABORTED! MASTER.LST file already exists!":\
STOP\
ELSE\
CREATE file.form$ AS 2
PRINT:PRINT:PRINT\
" ++ Creating " + file.form$ + " file ++";
IF END #1 THEN all.formatted
count% = 1
PRINT USING "&";#2;\
"MASTER.LST - Master CP/M Catalog as of " + todays.date$
PRINT USING "&";#2;" "
PRINT USING "&";#2;\
"filename.typ - dsk | filename.typ - dsk | filename.typ - dsk"
PRINT USING "&";#2;\
"----------------------------------------------------------------------"
WHILE true%
formatting.it:
IF count% = 4 THEN\
count% = 1:\
GOSUB output.the.line
READ #1;LINE input.line$
IF MID$(input.line$,4,5) = "DONE:" THEN\
done$ = input.line$:\
PRINT USING "&";#2;input.line$:\
GOTO formatting.it
IF LEFT$(input.line$,9) = " " THEN\
done2$ = input.line$:\
PRINT USING "&";#2;input.line$:\
GOTO all.formatted
IF count% = 1 THEN file1$ = LEFT$(input.line$,20)
IF count% = 2 THEN file2$ = LEFT$(input.line$,20)
IF count% = 3 THEN file3$ = LEFT$(input.line$,20)
count% = count% + 1
GOTO formatting.it
WEND
output.the.line:
PRINT USING "& & & & &";#2;file1$,fil.sep$,file2$,fil.sep$,file3$
RETURN
all.formatted:
CLOSE 1
CLOSE 2
PRINT:PRINT:PRINT:PRINT\
" " + done$
PRINT\
" " + done2$ + bell$
STOP
REM ----------------------------[ error handler ]----------------------------\
error.handler:
IF ERR = "DW" OR ERR = "ME" THEN\
PRINT:PRINT\
" Operating system reports an error!!":\
PRINT:PRINT\
" Check disk for FREE space available" + bell$\
ELSE\
PRINT:PRINT bell$ +\
" Error Code --> ";err
STOP
REM --------------------------[ the end ... ]-------------------------------\