.; [205,2]ALE.CMD		MAO		13-MAY-80
.;
.; INDIRECT MCR FILE TO TRANSLATE AND ASSEMBLE ALECS MODULES
.;
.; CALLING SEQUENCE:  @[205,2]ALE NAME MACSW
.;	WHERE	NAME=FILE NAME (WITHOUT EXTENSION) FOR ALECS INPUT FILE.
.;		MACSW=ANY MAC SWITCHES TO BE USED (MAY BE BLANK).
.;
.; IF NAME IS NOT GIVEN (EG. @ALE<CR>), INFORMATION IS PROMPTED FOR
.;	UNTIL A ^Z IS GIVEN OR A FATAL ERROR OCCURS.
.; IF NAME IS GIVEN, THE GIVEN MODULE IS PROCESSED AND ALE.CMD EXITS.
.;
.; REVISIONS
.; 20-MAY-80 (MAO) CHECK SW FOR ERROR VALIDITY; FIX SYNTAX ERROR FOR EXITS.
.;
.;
	.ENABLE SUBSTITUTION
.;
	.IF P1 EQ "" .GOTO 10$		;MUST PROMPT FOR INPUT
.;
	.SETT WASCMD			;INPUT WAS IN COMMAND LINE
	.SETS NAM "'P1'"
	.SETS SW  "'P2'"
	.GOTO TRAN
.;
.10$:	.SETF WASCMD			;NO COMMAND LINE GIVEN, PROMPT
.;
.QUERY:
.;
	.ASKS NAM GIVE ALE FILE NAME (^Z TO EXIT)
	.ASKS SW GIVE MAC SWITCHES
.;
.TRAN:
	.SETS TEMP SW[1:1]
	.IF TEMP EQ "" .OR .IF TEMP EQ "/" .GOTO 20$
; FIRST CHARACTER OF MAC SWITCH NOT A "/"
	.EXIT 4
.;
.20$:
	PIP 'NAM'.OBJ;*,'NAM'.ALL;*/DE
.;
	ALE 'NAM','NAM'/-SP='NAM'
	.IF <EXSTAT> GT 1 .EXIT <EXSTAT>
.;
	MAC 'NAM','NAM'/-SP='NAM''SW'
	.IF <EXSTAT> GT 1 .EXIT <EXSTAT>
.;
	PIP 'NAM'.ALL='NAM'.LST/AP
	PIP 'NAM'.MAC;*,'NAM'.LST;*/DE
.;
	.IFF WASCMD .GOTO QUERY	;IF WAS NO CMD LINE, PROMPT FOR MORE
	.EXIT 1
.;
.; END OF FILE ALE.CMD
