.; LIST - Issue commands with inserts from a list in a file  1-SEP-80   LMF
.;
	.ENABLE SUBSTITUTION
	.SETF SRD
	.SETS SRDC P1
	.IF P1 NE "" .GOTO 0
	.ASKS INFILE  Enter list file spec
	.IF INFILE NE "" .GOTO 1
	.ASKS SRDC Enter SRD select string
.0:	.SETS INFILE "TEMPLIST.LST;1
	SRD 'INFILE'='SRDC'
	.SETT SRD
.1:
	.SETS PROTO " 'P2' 'P3' 'P4' 'P5'"
	.DISABLE SUBSTITUTION
.IF P2 EQ "" ; Enter command line prototype with 'TEXT' at insertion point 
	.IF P2 EQ "" .ASKS PROTO
	.PARSE PROTO "'" A1 A2 A3 A4 A5 A6
	.IF A2 NE "" .GOTO 5
;
; You must specify an insertion point by including a
; character string:   'TEXT'  (or something) at the location
; where the lines from the listing file are to be inserted
;
	.GOTO 1
.5:
	.PARSE PROTO "|" PROTO PT1 PT2 PT3 PT4 PT5 REST
	.ENABLE SUBSTITUTION
.;
.;.. create the executable file

	.OPEN #1 TEMP.CMD;1
.DATA #1 .ENABLE SUBSTITUTION
.DATA #1 .ENABLE LOWERCASE
.DATA #1 .OPENR 'INFILE'
.;.. skip SRD header?
.IFT SRD .DATA #1 .READ 'A2'
.DATA #1 .10:
.DATA #1 .READ 'A2'
.DATA #1 .IFT <EOF> .GOTO END
.DATA #1 'PROTO'
.IF PT1 NE "" .DATA #1 'PT1'
.IF PT2 NE "" .DATA #1 'PT2'
.IF PT3 NE "" .DATA #1 'PT3'
.IF PT4 NE "" .DATA #1 'PT4'
.DATA #1 .GOTO 10
.DATA #1 .END:
.IFT SRD .DATA #1 PIP 'INFILE'/DE
	.CLOSE #1
	@TEMP.CMD;1
