.; [205,2]FLE.CMD		MAO		13-MAY-80
.;
.; INDIRECT MCR FILE TO TRANSLATE AND COMPILE FLECS MODULES
.;
.; CALLING SEQUENCE:  @[205,2]FLE NAME F4PSW
.;	WHERE	NAME=FILE NAME (WITHOUT EXTENSION) FOR FLECS INPUT FILE.
.;		F4PSW=ANY F4P SWITCHES TO BE USED (MAY BE BLANK).
.;
.; IF NAME IS NOT GIVEN (EG. @FLE<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 FLE.CMD EXITS.
.;
.;
.; REVISIONS
.; 20-MAY-80 (MAO) CHECK SW FOR VALIDITY; FIX SYNTAX ERROR FOR ERROR 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 FLE FILE NAME (^Z TO EXIT)
	.ASKS SW GIVE F4P SWITCHES
.;
.TRAN:
	.SETS TEMP SW[1:1]
	.IF TEMP EQ "" .OR .IF TEMP EQ "/" .GOTO 20$
; FIRST CHARACTER OF F4P SWITCH NOT A "/"
	.EXIT 4
.;
.20$:
	PIP 'NAM'.OBJ;*,'NAM'.FLL;*/DE
.;
	FLE 'NAM','NAM'/-SP='NAM'
	.IF <EXSTAT> GT 1 .EXIT <EXSTAT>
.;
	F4P 'NAM','NAM'='NAM''SW'/-SP
	.IF <EXSTAT> GT 1 .EXIT <EXSTAT>
.;
	PIP 'NAM'.FLL='NAM'.LST/AP
	PIP 'NAM'.LST;*,'NAM'.FTN;*/DE
.;
	.IFF WASCMD .GOTO QUERY	;IF WAS NO CMD LINE, PROMPT FOR MORE
	.EXIT 1
.;
.; END OF FILE FLE.CMD
