100	'

	'	S P O O L R

	'
110	'	Program		:SPOOLR

	'	Version		:2A

	'	Edit		:01

	'	Edit Date	:29-OCT-79

	'
120	'	Author		:FRS

	'
130	'	C O P Y R I G H T

	'

	'	Copyright (C) 1979

	'	Fred R. Scalf, Jr.

	'	1417 N. Fourth Ave.

	'	Knoxville, Tennessee 37917

	'	(615) 522-2766

	'
140	'

	'	M O D I F I C A T I O N   H I S T O R Y

	'

	'	VER/ED		EDIT DATE	PURPOSE

	'
150	'	2A-01		29-OCT-79	Handle UC/LC input

	'
160	'	G E N E R A L   D E S C R I P T I O N

	'
170	' SPOOLR was created to facilitate printing of ASCII files

	' to the Line Printer or list device. Up to 50 file names may

	' be entered upon program initiation. Once entered, the

	' files will be listed with pagination.

	'
180	CLEAR 1000
190	VER$="2A-01"	:' SET UP THE EDIT VERSION
200	PRINT
210	PRINT TAB(19);"S P O O L R   "+VER$ :PRINT
220     DIM I$(50),T$(30)
230     ON ERROR GOTO 1130
240	PRINT "Program spooling routine ... with paging."
250     PRINT 
260	PRINT "Input today's date in the form '22-JAN-79' ";
270	LINE INPUT DATE$
280	PRINT
290	PRINT "Enter program names (with extensions) one at a time."
300	PRINT "Enter a <CR> when done."
310     PRINT 
320     N9 = 1
330     G9 = 0
340	M$="Can't print '" : M1$="' files."
350	PRINT
360	PRINT "? "; : LINE INPUT N$
370	J$=""
380	FOR I%=1 TO LEN(N$)
390	N%=ASC(MID$(N$,I%,1))
400	IF N%>96 AND N%<123 THEN N%=N%-32
410	J$=J$+CHR$(N%)
420	NEXT I%
430     J% = INSTR(1,J$,".")
440     IF J% = 0 THEN 500
450	K$=MID$(J$,J%+1,LEN(J$))
460	IF K$="COM" THEN PRINT M$;K$;M1$ : GOTO 350
470	IF K$="REL" THEN PRINT M$;K$;M1$ : GOTO 350
480	IF K$="INT" THEN PRINT M$;K$;M1$ : GOTO 350
490	IF K$="OBJ" THEN PRINT M$;K$;M1$ : GOTO 350
500     I$(N9) = J$
510     IF I$(N9) = "" THEN 540
520     N9 = N9+1
530     GOTO 360
540     N9 = N9-1
550     PRINT 
560	PRINT "Set printer at a page boundary and hit 'RETURN' ...";
570	LINE INPUT A$
580	LPRINT
590     FOR K9 = 1 TO N9
600     P$ = I$(K9)
610	OPEN "I",1,P$
620     P = 1
630     GOSUB 1010 
640	IF EOF(1) THEN 1260
650	LINE INPUT #1, A$
660	IF LEFT$(A$,1)=CHR$(12) THEN GOSUB 970

	: GOSUB 1010

	: A$=MID$(A$,2,LEN(A$))
670	Z = 1 : B$ = ""
680	Y = INSTR(Z,A$,CHR$(10))
690	IF Y=0 THEN 730
700	B$=MID$(A$,Y+1,LEN(A$))
710	IF LEFT$(B$,1)=CHR$(12) THEN B$=MID$(B$,2,LEN(B$))
720	A$=LEFT$(A$,Y-1)
730	GOSUB 760
740	A$ = B$
750	IF A$="" THEN 640 ELSE GOTO 670
760	'

	' SUBROUTINE TO PRINT LINE, CONVERTING TABS TO BLANKS

	'
770	O$ = ""
780	IF LEFT$(A$,1)=CHR$(13) THEN A$=MID$(A$,2,LEN(A$))
790     FOR I = 1 TO LEN(A$)
800     M$ = MID$(A$,I,1)
810     IF M$ = CHR$(9) THEN 840
820     O$ = O$+M$
830     GOTO 850
840	O$ = O$ + SPACE$(8 - (LEN(O$) AND 7))
850	NEXT I
860	IF O$ = "" THEN 910
870	FOR J = LEN(O$) TO 1 STEP -1
880	IF MID$(O$,J,1) <> " " THEN 900
890	NEXT J
900	O$ = LEFT$(O$,J) :	' TRIM THE TRAILING BLANKS
910	LPRINT O$
920	' FOLLOWING NEEDED IF LPT DOES CR/LF AT COLUMN 80
930	' IF LEN(O$) > 80 THEN L=L+1
940	L = L+1
950	IF L >= 51 THEN GOSUB 970 : GOSUB 1010
960	RETURN
970	'

	' SUBROUTINE TO ADVANCE TO END OF CURRENT PAGE

	'
980	FOR I = L TO 56 : LPRINT : NEXT I
990	P = P+1
1000	RETURN
1010	'

	' SUBROUTINE TO PRINT PAGE HEADER

	'
1020	LPRINT : LPRINT : LPRINT : LPRINT
1030	LPRINT TAB(32);"-";P;"-"
1040	LPRINT : LPRINT
1050	IF MID$(P$,2,1)=":" THEN P$=MID$(P$,3,LEN(P$))
1060	LPRINT P$;
1070	IF P = 1 THEN 1090
1080	LPRINT "  (CONT)";
1090	LPRINT TAB(68-LEN(DATE$));DATE$
1100	LPRINT : LPRINT 
1110	L = 1
1120	RETURN
1130	IF ERR = 62 THEN IF ERL = 650 THEN RESUME 1260
1140	IF ERR = 64 THEN IF ERL = 610 THEN RESUME 1190
1150	IF ERR = 53 THEN IF ERL = 610 THEN RESUME 1210
1160	IF ERR = 56 THEN IF ERL = 610 THEN RESUME 1230
1170	IF ERR = 55 THEN IF ERL = 610 THEN CLOSE 1 : RESUME 610
1180	ON ERROR GOTO 0
1190	T$(G9) = P$+SPACE$(20-LEN(P$))+"Illegal File Name"
1200	GOTO 1240
1210    T$(G9) = P$+SPACE$(20-LEN(P$))+"File Not Found"
1220	GOTO 1240
1230	T$(G9) = P$+SPACE$(20-LEN(P$))+"Disk Not Mounted"
1240    G9 = G9+1
1250    GOTO 1290
1260	'

	' EXIT ROUTINE

	'
1270	GOSUB 970 :	' SKIP TO END OF PAGE
1280	CLOSE 1
1290	NEXT K9
1300    IF G9 = 0 THEN 1360
1310	PRINT "Unable to print the following files:"
1320    PRINT
1330    FOR I = 0 TO G9-1
1340    PRINT T$(I)
1350    NEXT I
1360    END
le to print the followi