Replace Text command

Purpose: Replaces all occurrences of the first string in the specified
range of lines with the second string.

Notes:

1. If you omit the second string, Replace Text deletes all
occurrences of the first string within the specified
range of lines. If you omit both strings, EDLIN re-uses
the search string entered with the most recent (previous)
S or R command, and the Replace Text string entered
with the last R command.

2. This command uses the F6 key as normally set up by DOS,
that is to output a Ctrl-Z character when pressed. You
may also press Ctrl-Z where F6 is referred to below.

EDLIN displays the changed lines each time they are changed.
The last line changed becomes the current line.


Format: [line][,line][?]R[string][<F6>string]

Remarks: You can specify the optional parameter ? to request a prompt
(O.K.?) after each display of a modified line. Press Y or
the Enter key if you want to keep the modification.

Enter any other character if you don't want the modification.
In either case, the search string continues for further oc-
currences of the first string within the range of lines, in-
cluding multiple occurrences within the same line.

Defaults occur if either one or both of the line parameters
are missing.

If you omit the first line, the search begins with the line
after the current line. If you omit the second line, the
search ends with the last line in memory. If you omit both
line parameters, the system searches from the line follow-
ing the current line to the last line in memory.

Note:
The first string begins with the character in the position
immediately following the R, and continues until you press
F6 or Ctrl-Z (or the Enter key if the second string is omit-
ted).
The second string begins immediately after you press F6 or
Ctrl-Z and continues until you press Enter.

Example: Assume that you want to edit the following file. Line 7 is the
current line.

1: This is a sample file
2: used to demonstrate
3: the Replace and Search Text commands.
4: This includes the
5: optional parameter ?
6: and required string
7:*parameter.

To replace all occurrences of and with or in the lines
in memory, type 1,7 Rand press F6, type or and press Enter.

The result is:

3: the Replace or Search Text commands.
3: the Replace or Search Text commors.
6: or required string


Line 6 becomes the current line in the file, because line 6
was the last line changed. Notice that lines 1,2,4,5, and 7
are not displayed because they were not changed.

Greater selectivity can be achieved by requesting a prompt
(by using the ? parameter) after each display of a modified
line. If you request a prompt, the screen looks like this:

*1,7 ? Rand press F6, type or and press Enter.

3: the Replace or Search Text commands.
O.K.? Y
3: the Replace or Search Text commors.
O.K.? N
6: or required string
O.K.? Y
*

Lines 3 and 6 are displayed like this:

3: the Replace or Search Text commands.
6: or required string