.; LP11.CMD
.; EDITED 14-JAN-80	SMR	RSX11-M-PLUS
.; EDITED 28-OCT-80	JML	REMOVE ASN FOR LP0
.; EDITED 17-NOV-80	JML	GENERALIZE FOR LP/TT SUPPORT
.; EDITED 19-NOV-80	JML	DO NOT INS DESPOOLERS AS SLAVED TASKS
.; EDITED 11-JAN-81	JML	DO NOT SET TTY SPEED 
.; EDITED 05-MAY-81	SMR	INSTALL LPP'S IN AMTBUF
.; 	20-APR-81	SMR	FX DEV.
.;	1-JUL-81	SMR	PAPRAMETERIZE PARTITION
	.ENABLE SUBSTITUTION
	.ENABLE GLOBAL
	.SETS SPLPAR "GEN"
	.SETN ZERO 0
	.IFNDF $NUM .GOTO 5$
	.GOTO 10$
.;
.5$:
	.ASKN $NUM ENTER TERMINAL NUMBER TO MAKE THE LINE PRINTER
	.ASK $PRINT IS THIS A DEFAULT (PRINT) DEVICE FOR SPOOLING
	.SETT $TTY
	.ASKN $FL How many flag pages
.10$:
	.IFT $TTY .AND .IF $NUM = ZERO .GOTO END
	.IFT $TTY .SETS DSPLER "TTP'$NUM'"
	.IFT $TTY .SETS QUENAM "TTQ'$NUM'"
	.IFF $TTY .SETS DSPLER "LPP'$NUM'"
	.IFF $TTY .SETS QUENAM "LPQ'$NUM'"
	.IFNACT 'DSPLER' .GOTO 15
; ******    TT'$NUM': ALREADY SPOOLED   ********
	.GOTO END
.15:
;
	.IFF $TTY .GOTO 25

	SET /LA120=TT'$NUM':
	SET /SLAVE=TT'$NUM':
	SET /NOLOWER=TT'$NUM':
	SET /NOHOLD=TT'$NUM':

.25:
	.IFINS QMG... .GOTO QMGINS
	.TESTFILE LB:'<SYSUIC>'QMGFSL.TSK
	.IF <FILERR> NE 1 .GOTO 1
	INS $QMGFSL/CKP=YES/PAR='SPLPAR'
	.IF <EXSTAT> EQ 1 .GOTO QMGINS
.;
.1:	INS $QMG/CKP=YES/PAR='SPLPAR'
.;
.; NOW START THE QUE MANAGER
.;
.QMGINS:
	.IFNACT QMG... START/QUEUE/MANAGER
	.IFNINS PRT... INS  $QMGPRT/TASK=PRT.../SLV=NO/PAR='SPLPAR'
	.IFNINS 'DSPLER' INS $LPP/TASK='DSPLER'/INC=0/PAR='SPLPAR'
.20:
	.IFACT QMG... .GOTO 30
	.DELAY 1S
	.GOTO 20
.30:
	.TESTFILE LB:[1,7]QUEUE.SYS
	.IF <FILERR> EQ 1 .GOTO 40
	INITIALIZE/QUEUE 'QUENAM'/PRINT
	INITIALIZE/QUEUE FOBQUE
.40:
.;
	INITIALIZE/PROCESSOR 'DSPLER'/FLAG:'$FL'/FORM:0
	.IF <EXSTAT> EQ 1 .GOTO 50
.;
.; MUST INITIALIZE QUEUE
	INITIALIZE/QUEUE 'QUENAM'/PRINT
	INITIALIZE/PROCESSOR 'DSPLER'/FLAG:'$FL'/FORM:0
.50:
.;
	.IFT $PRINT ASSIGN/QUEUE PRINT 'DSPLER'
	.;ASSIGN/QUEUE	'QUENAM'	'DSPLER'
.END:
