.;+
.;  C M D . C M D	V02  GENERAL COMMAND LINE REPEATER	LMF 25-SEP-79
.;			V03	FOR RSX11M V3.2 AND PLUS V1.0	LMF 23-APR-80
.;			V04  ADD REPEAT COUNT W/O SUBSTITUTIONS	LMF 01-OCT-80
.;			V04A ADD MULTI-LINE CAPABILITY		LMF 25-OCT-80
.;-
	.ENABLE GLOBAL
	.DISABLE SUBSTITUTION
	.IF P1 NE "" .GOTO 00
;
; Enter command skeleton with 'A','B',...'F' etc
; where fields are to be replaced.
;
	.GOTO 1
.00:	.TEST COMMAN
	.SETN A <STRLEN>
	.TEST P0
	.SETN B <STRLEN>
	.IF A LE B+1 .GOTO 1
	.SETS CMD COMMAN[B+1:A]
	.GOTO 2
.1:	.ASKS CMD Enter command
.2:	.PARSE CMD "'" L1 I1 L2 I2 L3 I3 L4 I4 L5 I5 L6 I6 L7 I7 REST
	.SETN N <STRLEN>/2
	.PARSE CMD "|" CMD CMD1 CMD2 CMD3 REST
	.ENABLE SUBSTITUTION
	.OPEN TMP.CMD;1
	.DATA .ENABLE SUBSTITUTION
	.DATA .ENABLE LOWERCASE
	.DATA .ENABLE GLOBAL
	.SETN MAX 177777
	.IF N EQ 0 .ASKN MAX Enter repeat count
	.IF N EQ 0 .AND .IFF <DEFAUL> .DATA .SETN $COUNT 'MAX'
	.IF N EQ 0 .AND .IFT <DEFAUL> .DATA .SETN $COUNT 177777
	.DATA .10:
	.IF N EQ 0 .GOTO 99
	.IF N GT 1 .DATA ; Enter:
	.IF N GT 1 .IF I1 NE "" .DATA .ASKS 'I1' 'I1'
	.IF N EQ 1 .IF I1 NE "" .DATA .ASKS 'I1' Enter 'I1':
.;
	.IF N EQ 1 .GOTO 99
	.IF I2 NE "" .DATA .IFNDF 'I2' .ASKS 'I2' 'I2'
	.IF N EQ 2 .GOTO 99
	.IF I3 NE "" .DATA .IFNDF 'I3' .ASKS 'I3' 'I3'
	.IF N EQ 3 .GOTO 99
	.IF I4 NE "" .DATA .IFNDF 'I4' .ASKS 'I4' 'I4'
	.IF N EQ 4 .GOTO 99
	.IF I5 NE "" .DATA .IFNDF 'I5' .ASKS 'I5' 'I5'
	.IF N EQ 5 .GOTO 99
	.IF I6 NE "" .DATA .IFNDF 'I6' .ASKS 'I6' 'I6'
	.IF N EQ 6 .GOTO 99
	.IF I7 NE "" .DATA .IFNDF 'I7' .ASKS 'I7' 'I7'
.99:
	.DATA 'CMD'
	.IF CMD1 NE "" .DATA 'CMD1'
	.IF CMD2 NE "" .DATA 'CMD2'
	.IF CMD3 NE "" .DATA 'CMD3'
	.DATA .ERASE LOCAL
	.IF N EQ 0 .DATA .DEC $COUNT
	.IF N EQ 0 .DATA .IF $COUNT EQ 0 .STOP
	.DATA .GOTO 10
	.CLOSE
.;
	@TMP.CMD;1
