.SETT $QUIET
.IFNDF P1 .SETS P1 ""
.IF P1 EQ "Q" .SETF $QUIET
.DISABLE LOWERCASE
.IFT $QUIET .ENABLE QUIET
.ENABLE SUBSTITUTION
.;
.;
.ASK QMG Do you want to change forms on a device
.IFF QMG .GOTO Q2
.GOSUB SPDEV
.NEWFRM:
.ASK QMG Do you want a description of the available forms
.IFF QMG .GOTO NOFL
.IFT $QUIET .DISABLE QUIET
; FORM 0 = 132 x 66 on 14" x 11", for the line printer (default on PRINT)
; FORM 1 = 80 x 66 on 8.5" x 11", upper/lower case (for the Decwriters)
; FORM 2 = 132 x 66 on 11" x 8.5" (sideways) for the LA-120's
;			character size automatically reduced to
;			12 C.P.I & 8 L.P.I.
; FORM 3 = 132 X 66 8.5" X 11", char size automatically reduced to
;			16.5 C.P.I. & 6 L.P.I.
;			(regular listing on 8.5 by 11 paper)
; FORM 4 = 102 X 66 on 8.5" x 11", upper/lower case for LA-120 (PASCAL LIST)
;			12 c.p.i. & 6 l.p.i.
;
; Normally, the large line printer takes care of FORM 0, and the LA-120's
;	take care of the other forms.
; The line-printer only prints upper-case.
.IFT $QUIET .ENABLE QUIET
.NOFL:
.SETN FN 9.
.ASKN [0.:4.] FN New form number
.IF DEV NE "TT4" .OR .IF FN EQ 1 .GOTO NOFL1
.IFT $QUIET .DISABLE QUIET
; TT4 only handles form #1
.STOP
.;
.NOFL1:
.IF DEV = "LP0" .AND .IF FN <> 0 .GOSUB LPFORM
.IF DEV = "TT21" .AND .IF FN = 0 .GOSUB TTFORM
QUE 'DEV':/STOP:EOJ
QUE 'DEV':/UNSPOOL
MUN SETFORM/NOINI,'DEV' 'FN'
QUE 'DEV':/SPOOL/FORM:'FN'/FLAG:'FLAG'
.IF <EXSTAT> GT 1 .STOP <EXSTAT>
;BRO ALL:SPOOL DEVICE 'DEV': FORMS CHANGED TO #'FN'
.ASK QMG Do you want to print the test form
.IFT QMG PRINT 'DEV':/FORM:'FN'/NOFLAG/PRI:250.=PRINTER.TST
.IF DTYP = "LP" QUE 'DEV':/ASSIGN:PRINT
.IF DEV = "TT21" QUE 'DEV':/ASSIGN:PRINT
.STOP
.;
.;
.Q2:
.ASK Q Do you want to stop a spooled device
.IFF Q .GOTO Q1
.GOSUB SPDEV
.QM1:
.ASKS F Stop it now, at end-of-file, or at end-of-job (N, F, J)
.SETS F11 F[1:1]
.IF F11 = "N" .SETS F1 ""
.IF F11 = "F" .SETS F1 ":EOF"
.IF F11 = "J" .SETS F1 ":EOJ"
.IF F1 = "?" .GOTO QM1
QUE 'DEV':/STOP'F1'
.ASK QMG Un-spool it
.IFF QMG .GOTO Q1
QUE 'DEV':/UNSPOOL
DLY 5S
.IFACT 'PRC' ABO 'PRC'
.IF DTYP = "TT" SET /NOSLAVE='DEV':
.;
.;
.Q1:
.ASK QMG Do you want to restart a device
.IFF QMG .GOTO Q3
.GOSUB SPDEV
QUE 'DEV':/STOP
QUE 'DEV':/UNSPOOL
.IF DTYP = "TT" SET /SLAVE='DEV':
QUE 'DEV':/SPOOL/FORM:255.
.IF <EXSTAT> NE 1 .STOP
QUE 'DEV':/STOP
.IF <EXSTAT> EQ 1 .GOTO NEWFRM
.STOP
.;
.; 
.Q3:
.SETS TYPE "DEL"
.ASK QMG Do you want to remove a job from the spooler queue
.IFT QMG .GOTO QCNTL
.SETS TYPE "REL"
.ASK QMG Do you want to release a held print job
.IFT QMG .GOTO QCNTL
.SETS TYPE "HOLD"
.ASK QMG Do you want to hold a print job
.IFT QMG .GOTO QCNTL
.STOP

;;;;;;;;;;;;;; 
.QCNTL:
.IFT $QUIET .DISABLE QUIET
;Enter queue job # as "nnn:mmm"
; Enter "?" to display the queue
; Enter ^Z to quit
.IFT $QUIET .ENABLE QUIET
.JOB:
.ASKS JOB JOB
.IF JOB = "?" QUE /BR:ALLQUE
.IF JOB = "?" .GOTO JOB
QUE /JOB:'JOB'/'TYPE'
.GOTO JOB


; GET A SPOOLING DEVICE NAME
.SPDEV:
.SETN FLAG 1
.ASKS DEV Which device (DDu)
.SETS PRC DEV[1:2]+"P"+DEV[3:4]
.SETS DTYP DEV[1:2]
.;
.IF DEV = "LP0" .GOTO SP1
.IF DEV = "TT21" .GOTO SP1
.IF DEV = "TT4" .GOTO SP1
.IFT $QUIET .DISABLE QUIET
; ERROR - Allowable devices are:   LP0   TT21   TT4
.IFT $QUIET .ENABLE QUIET
.GOTO SPDEV
.;
.SP1:
.SETS F1 "?"
.IF DEV = "TT4" .SETN FLAG 0
.RETURN

; USER SELECTED AN UNUSUAL FORM FOR THE DEVICE
.LPFORM:
.IFT $QUIET .DISABLE QUIET
;	The usual form for the line-printer is #0.
.FORMQ:
.IFT $QUIET .ENABLE QUIET
.ASK QMG Do you really want to set this form????????
.IFF QMG .STOP
.RETURN

.TTFORM:
.IFT $QUIET .DISABLE QUIET
;	The usual form for the Decwriter is 1, 2, or 3.
.GOTO FORMQ

