	.IFDF $A .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
	;
	;	$A = TASKNAME -- IF DEFINED, DO NOT ERASE SCREEN OR PROMPT
	;			 FOR TASKNAME.
	;	$B = (NO)LIST -- IF DEFINED, DO NOT PROMPT FOR LISTING ANSWER.
	;			 IF NOT DEFINED ASK.
	;	$C = (NO)BUILD - IF DEFINED, DO NOT ASK IF TASKBUILD DESIRED.
	;			 IF DEFINED, DO NOT BUILD WITH ANY OF THE 
	;			 OPTIONAL LIBRARIES.
	;	$D = (NO)MAP  -- IF DEFINED TO NOT ASK WHETHER MAP DESIRED
	;	$E = (NO,YES) -- IF = YES, BUILD WITH UIC=[200,200]
	;
	.SETF NAME
	.IFNDF $A PAGE
.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
	.IFDF $A .SETT NAME
	.IFDF $A .SETF SCI
	.IFT NAME .GOTO 22
.20:	.IFF NAME .ASKS $A WHAT IS THE FORTRAN PROGRAM NAME
	.SETT NAME
.22:	.IF $A EQ CR .GOTO EXIT
	.TEST $A
	.IFF <ALPHAN> ;FILE NAME ONLY -- OMIT FILE NAME EXTENSION
	.IF <STRLEN> >9. ;NAMES LONGER THAN 9 CHARACTERS ARE NOT ALLOWED
	.IFF <ALPHAN> .OR .IF <STRLEN> >9. .SETF NAME
	.IFF NAME .GOTO 20
	.SETS REPORT $A+".FTN"
	.IFNEXI 'REPORT' .SETT NOSRC
	.IFF NOSRC .GOTO 22A
	; NO SOURCE FILE WITH GIVEN NAME
	TCF 7
	.SETF NAME
	.GOTO 20
.22A:	.SETS UIC <UIC>
	.SETS GRP UIC[2:4]
	.SETS MEM UIC[6.:8.]
	.IFNDF $B .GOTO 24
	.IFDF $B .AND .IF $B EQ "LIST" .SETT LST
	.IFDF $B .AND .IF $B EQ "NOLIST" .SETF LST
	.IF $B EQ "NOLIST" .GOTO 26
.24:	.IFF LST .ASK LST 	DO YOU WANT A LISTING
	.IFT LST .SETS $LST ",TI:/LI:1"
 
.26:	.OPEN '$A'.CMD;1
	.DATA .ENABLE SUBSTITUTION
	.DATA .SETF NOOBJ
	.DATA F4P '$A'.OBJ;1'$LST'='$A'.FTN/TR:ALL/CO:25.
	.DATA .SETS REPORT "'$A'"+".OBJ;1"
	.DISABLE SUBSTITUTION
	.DATA .IFNEXI 'REPORT' .SETT NOOBJ
	.ENABLE SUBSTITUTION
	.DATA .IFT NOOBJ ;FATAL F4P COMPILATION ERROR
	.DATA .IFT NOOBJ .GOTO DONE
	.IFNDF $C .GOTO 30
	.IFDF $C .SETS BLD $C
	.IFDF $C .GOTO 32
.30:	.ASKS BLD TASKBUILD [Y,N,TCS,ADGRF]
.32:	.IF BLD EQ CR .GOTO EXIT
	.IF BLD EQ "BUILD" .SETS BLD YES
	.IF BLD EQ "NOBUILD" .SETS BLD "N"
	.IF BLD EQ NO .GOTO EXIT
	.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
	.IFNDF $D .GOTO 33
	.IFDF $D .IF $D EQ "MAP" .SETT MAP
	.IFDF $D .IF $D EQ "NOMAP" .GOTO 34
	.IFDF $D .AND .IFT MAP .GOTO 34
.33:	.ASK MAP DO YOU WANT A MAP FROM THE TASKBUILDER
.34:	.IFNDF $E .GOTO 35
	.IFDF $E .IF $E EQ "YES" .SETT MLTUSR
	.IFDF $E .IF $E EQ "NO" .GOTO 38
.35:	.IFF MLTUSR .ASK MLTUSR BUILD A MULTIUSER TASK
.38:	.IFT MAP .SETS $MP ",TI:"
 
 
	  .DATA .OPEN #1 '$A'.BLD;1
	  .DATA .DATA #1 '$A'.TSK;1/CP/FP'$MP'='$A'
	  .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 '$A'.FTN/PU
	.DATA TKB @'$A'.BLD;1
	.DATA PIP '$A'.OBJ;1/DE,'$A'.BLD;1
	.DATA .DONE:
	.CLOSE
	PIP '$A'.CMD;1/TR
	;
	;
	.ASKS PASWRD ENTER LOGON PASSWORD
	.XQT SUB 'GRP'/'MEM'/'PASWRD' '$A'
	TCF 33,14
.EXIT:	;
