C*	QXIN	- PARSE INPUT COMMAND LINE
C
	SUBROUTINE QXIN
C
	INCLUDE 'QXCM.COM/NOLIST'
C
	DIMENSION BUF(80), BTEMP(32), BSW(6,2), ITASK(16)
	EQUIVALENCE (ITASK,BTEMP)
C
	DATA BSW/'E','O','T','R','P',0, 'C','W','I','E','D',0/
	DATA BCR/13/, ILUN/1/
C
C
C	GET THE MCR COMMAND LINE
C
	CALL GETMCR (BUF, IDSW)
	IF (IDSW .LT. 0) STOP '**ERROR** ON GETMCR'
C
	CALL STBLK (BUF, BUF, 80)
	I = 3			! $$$QX - 2 CHARACTERS + CARRIAGE RETURN
C
C	BEGIN LOOKING FOR SWITCHES, MUST HAVE EXACT SYNTAX
C
 100	CONTINUE
	IF (BUF(I) .EQ. BCR) GO TO 300		! END OF LINE
C
C	NOT END, IT BETTER BE A SWITCH '/'
C
	IF (BUF(I) .NE. '/') GO TO 410		! NOPE ERROR
	ISWV = IBLUF(BUF(I+1), BSW)
	IF (ISWV .LE. 0) GO TO 420		! ILLEGAL SWITCH
C
C	CHECK SECOND CHARACTER OF SWITCH NAME
C
	IF (BUF(I+2) .NE. BSW(ISWV,2)) GO TO 420
C
C	SWITCH IS OK, SET IT TO TRUE
C
	IF (LSW(ISWV)) GO TO 430		! MULTIPLY DEFINED SWITCH
	LSW(ISWV) = .TRUE.
	IF (.NOT. LSWTI) GO TO 200
C
C	/FU IS ON - CHECK IF A FILE SPEC IS ASSOCIATED WITH IT
C
	IF (BUF(I+3) .NE. ':') GO TO 200	! NOPE, GET THE NEXT SWITCH
C
C	THE ':' IS THERE, JUST GET THE FILESPEC, FIND THE STATS FOR THIS
C	FILE AND WE'RE DONE!
C
	J = I+4
	I = J
 150	CONTINUE
	IF (BUF(I).EQ.'/' .OR. BUF(I).EQ.BCR) GO TO 160
	I = I + 1
	GO TO 150
C
 160	CONTINUE
	IF (I .EQ. J) GO TO 440
	BUF(I) = 0				! ZERO BYTE FOR PARSE
C
C	PARSE THE FILE-SPEC AND PLUG DEFAULTS
C
	CALL FPARS (ILUN, BUF, J, 'LP.SPR', NER, BTEMP, NCTEMP)
	BTEMP(NCTEMP+1) = 0
	IF (NER .NE. 0) GO TO 440
C
C	NOW GET THE STATS AND PRINT THE RESULTS
C
	CALL QXPC (BTEMP, 'LP', 0, TCHR, TLNCNT, IPGCNT, TIME)
	CALL SFCHR (BTEMP, NCTEMP+1, 31-NCTEMP, ' ')
	TTIME = AMAX1 (TIME, TCHR/240./60.)		! @2400 BAUD IN MINS
	WRITE (5, 500) (BTEMP(I), I=1,31), TLNCNT, IPGCNT, TIME, TTIME
 500	FORMAT (/' FILE SPECIFICATION', 15X, 'LINES',2X,'PAGES',3X,
	1	'MINS @300 LPM  MINS @2400 BAUD',//
	1	' ',31A1,F8.0,I7,F12.1, 4X,F12.1/)
C
C	DONE, EXIT
C
	GO TO 490
C
C	SWITCH IS OK, UPDATE POINTER
C
 200	CONTINUE
	I = I + 3
	GO TO 100
C
C
 300	CONTINUE
C
C	CHECK FOR /OW, IF SO GET USERS DEFAULT UIC FOR COMPARING TO QUEUE ENTRY
C
	IF (.NOT. LSWOW) GO TO 310
	CALL GETTSK (ITASK, IDSW)
	IDFUIC = ITASK(16)
 310	CONTINUE
	RETURN
C
C	INPUT ERROR MESSAGES
C
 410	WRITE (5, 510)
 510	FORMAT (' **ERROR** SYNTAX ERROR')
	GO TO 490
C
 420	WRITE (5, 520)
 520	FORMAT (' **ERROR** ILLEGAL SWITCH')
	GO TO 490
C
 430	WRITE (5, 530)
 530	FORMAT (' **ERROR** MULTIPLY DEFINED SWITCH')
	GO TO 490
C
 440	WRITE (5, 540)
 540	FORMAT (' **ERROR** ILLEGAL FILE SPECIFICATION')
C
 490	CONTINUE
	CALL EXIT
C
	END
