REPEAT should not apply the repeated command to the
ending target line.
When REPEAT is given a line count as a target (e.g.
"repeat 2"), it works correctly (well, consistently
with XEDIT on VM, anyway). When it's given a locate
string or an absolute line number as a target (e.g.
"repeat /xxx/" or "repeat :6"), it is inconsistent with
XEDIT and with other commands (e.g. "del /xxx/" or "del
:6"), because it should stop repeating the command just
before the target line, but it also repeats the command
on the target line.
Example:
Do this once on real XEDIT on VM, and once on THE (I
tested with COMPAT XEDIT XEDIT XEDIT and COMPAT XEDIT
KEDIT XEDIT)
Create this 7 line file:
asdf
asdf
asdf
asdf
asdf
xxxxx
asdf
Perform the following series of commands:
:1
clocate :6
creplace zzz
repeat /xxx/ (this fails)
:1
clocate :10
creplace yy
repeat 2 (this works)
:1
clocate :13
creplace w
repeat :6 (this fails)
(note: due to another problem with the REPEAT command,
when you do the test on THE, you currently have to
issue the CREPLACE and REPEAT commands as:
rexx 'creplace zzz';'repeat /xxx/'
and
rexx 'creplace yy';'repeat 2'
and
rexx 'creplace w';'repeat :6'
)
Results:
XEDIT THE
asdf zzz yy w asdf zzz yy w
asdf zzz yy w asdf zzz yy w
asdf zzz yy w asdf zzz yy w
asdf zzz w asdf zzz w
asdf zzz w asdf zzz w
xxxxx xxxxxzzz w
asdf asdf
Note the difference at the 'xxxxx' line.
This is the problem.
Logged In: YES
user_id=86185
Confirmed the problem with the extra line processed with
REPEAT, but with my working version of THE, I don't need to
issue the commands as stated; ie:
creplace zzz
repeat /xxx/
work as expected as separate commands.
You could also use:
SET LINEND ON ;
CREPLACE zzz;REPEAT /xxx/