	.IF P1 EQ "" PAGE
	.IF P1 NE "" .GOTO 10
	;		B A T C H . C M D
	; THIS FILE WILL CREATE A BATCH ASSEMBLY AND/OR TASKBUILD FILE
	; USING ALL DEFAULT VALUES FOR F4P PROGRAMS.
	;
	;	WHEN THIS FILE EXITS, IT SUBMITS YOUR COMMAND FILE TO BATCH.
	;	THEREAFTER, TO RECOMPILE/BUILD YOUR PROGRAM, TYPE
	;		SUB GRP/MEM/PASWRD TSKNAM
	;
	;  WHERE:
	;	GRP   = GROUP NUMBER
	;	MEM   = MEMBER NUMBER
	;	PASWRD= LOGIN PASS WORD
	;	TSKNAM= TASK NAME OF FILE TO BUILD
	;
	;	THE FILE 'TSKNAM'.CMD;1   WILL EXIST WHEN @BATCH EXITS
	;	AFTER THIS FILE EXITS
	;
	;     ALL TASKS,OBJECT MODULES AND SOURCE FILES WILL BE PURGED
	;
	;	P1 = TASKNAME -- IF DEFINED, DO NOT ERASE SCREEN OR PROMPT
	;			 FOR TASKNAME.
	;	P2 = (NO)LIST -- IF DEFINED, DO NOT PROMPT FOR LISTING ANSWER.
	;			 IF NOT DEFINED ASK.
	;	P3 = (NO)BUILD - IF DEFINED, DO NOT ASK IF TASKBUILD DESIRED.
	;			 IF DEFINED, DO NOT BUILD WITH ANY OF THE 
	;			 OPTIONAL LIBRARIES.
	;	P4 = (NO)MAP  -- IF DEFINED TO NOT ASK WHETHER MAP DESIRED
	;	P5 = (NO,YES) -- IF = YES, BUILD WITH UIC=[200,200]
	;
	.SETF NAME
.10:	.SETF LST
	.SETF MAP
	.SETF NOSRC
	.SETF NOOBJ
	.SETT SCI
	.SETF MLTUSR
	.SETS $MP ""
	.SETS $LST ""
	.SETS TCS "TCS"
	.SETS ADGRF "ADGRF"
	.SETS YES "Y"
	.SETS NO "N"
	.SETS CR ""
	.SETS BLD ""
	.ONERR 20
	.IF P1 NE "" .SETT NAME
	.IF P1 NE "" .SETF SCI
	.IFT NAME .GOTO 22
.20:	.IFF NAME .ASKS P1 WHAT IS THE FORTRAN PROGRAM NAME
	.SETT NAME
.22:	.IF P1 EQ CR .GOTO EEXIT
	.TEST P1
	.DISABLE QUIET
	.IFF <ALPHAN> ;FILE NAME ONLY -- OMIT FILE NAME EXTENSION
	.IF <STRLEN> >9. ;NAMES LONGER THAN 9 CHARACTERS ARE NOT ALLOWED
	.ENABLE QUIET
	.IFF <ALPHAN> .OR .IF <STRLEN> >9. .SETF NAME
	.IFF NAME .GOTO 20
	.SETS REPORT P1+".FTN"
	.TESTFILE 'REPORT'
	.IF <FILERR> NE 1 .SETT NOSRC
	.IFF NOSRC .GOTO 22A
	.SETF NOSRC
	.DISABLE QUIET
	; NO SOURCE FILE WITH GIVEN NAME
	.ENABLE QUIET
	TCF 7
	.SETF NAME
	.GOTO 20
.22A:	.SETS UIC <UIC>
	.SETS GRP UIC[2:4]
	.SETS MEM UIC[6.:8.]
	.IF P2 EQ "" .GOTO 24
	.IF P2 NE "" .AND .IF P2 EQ "LIST" .SETT LST
	.IF P2 NE "" .AND .IF P2 EQ "NOLIST" .SETF LST
	.IF P2 EQ "NOLIST" .GOTO 26
.24:	.IFF LST .ASK LST 	DO YOU WANT A LISTING
	.IFT LST .SETS $LST ",TI:/LI:1"
 
.25:	; HERE
.26:	.OPEN 'P1'.CMD;1
	.DATA .ENABLE SUBSTITUTION
	.DATA .SETF NOOBJ
	.DATA F4P 'P1'.OBJ;1'$LST'='P1'.FTN/TR:ALL/CO:25.
	.DATA .IF <EXSTAT> NE 1 ;FATAL F4P COMPILATION ERROR
	.DATA .IF <EXSTAT> NE 1 .GOTO DONE
	.IF P3 EQ "" .GOTO 30
	.IF P3 NE "" .SETS BLD P3
	.IF P3 NE "" .GOTO 32
.30:	.ASKS BLD TASKBUILD [Y,N,TCS,ADGRF]
.32:	.IF BLD EQ CR .GOTO EEXIT
	.IF BLD EQ "BUILD" .SETS BLD YES
	.IF BLD EQ "NOBUILD" .SETS BLD "N"
	.IF BLD EQ NO .GOTO EEXIT
	.IFT SCI .ASK SCI BUILD WITH THE SCIENTIFIC SUBROUTINE PACKAGE
	.IF BLD NE TCS .AND .IF BLD NE YES .AND .IF BLD NE ADGRF .GOTO 30
	.IF P4 EQ "" .GOTO 33
	.IF P4 NE "" .IF P4 EQ "MAP" .SETT MAP
	.IF P4 NE "" .AND .IF P4 EQ "NOMAP" .GOTO 34
	.IFDF P4 .AND .IFT MAP .GOTO 34
.33:	.ASK MAP DO YOU WANT A MAP FROM THE TASKBUILDER
.34:	.IF P5 EQ "" .GOTO 35
	.IF P5 NE "" .AND .IF P5 EQ "YES" .SETT MLTUSR
	.IF P5 NE "" .AND .IF P5 EQ "NO" .GOTO 38
.35:	.IFF MLTUSR .ASK MLTUSR BUILD A MULTIUSER TASK
.38:	.IFT MAP .SETS $MP ",TI:"
 
 
	  .DATA .OPEN #1 'P1'.BLD;1
	  .DATA .DATA #1 'P1'.TSK;1/CP/FP'$MP'='P1'
	  .IFT SCI .DATA .DATA #1 [1,1]SCI/LB
	  .IF BLD EQ ADGRF .DATA .DATA #1 [1,1]AG/LB
	  .IF BLD EQ TCS .OR .IF BLD EQ ADGRF .DATA .DATA #1 [1,1]TCS/LB
	  .DATA .DATA #1 DK1:[1,1]F4POTS/LB
	  .DATA .DATA #1 /
	  .IFT MLTUSR .DATA .DATA #1 UIC=[200,200]
	  .DATA .DATA #1 LIBR=F4PRES:RO
	  .DATA .DATA #1 //
	  .DATA .CLOSE  #1
 
	.DATA PIP 'P1'.FTN/PU
	.DATA TKB @'P1'.BLD;1
	.DATA PIP 'P1'.OBJ;1/DE,'P1'.BLD;1
	.DATA .DONE:
	.CLOSE
	PIP 'P1'.CMD;1/TR
	;
	;
	.ASKS PASWRD ENTER LOGON PASSWORD
	.XQT SUB 'GRP'/'MEM'/'PASWRD' 'P1'
	TCF 33,14
.EEXIT:	;
