|
|
EDIT/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 EDIT/3000 COMMANDSMODIFY |
|
The MODIFY command modifies text records in the WORK file through the use of three MODIFY subcommands. The three MODIFY subcommands are as follows:
In an interactive session, the MODIFY command begins operation for each line in rangelist by displaying
then the contents of the line. If rangelist is not included in a MODIFY command, or if * is specified in rangelist, EDIT/3000 modifies the line containing the current location of the pointer. After one of the subcommands has been used to modify the line and RETURN has been pressed, EDIT/3000 displays the line again in its modified form unless the MODIFYQ form of the command has been used, in which case the modified line is not displayed. If the line is satisfactory, press RETURN and EDIT/3000 will print the next line to be modified (or terminate the MODIFY command if the last line in rangelist has been modified). If the line requires further modification, enter the appropriate subcommand. In an interactive session, to cancel the effect of a MODIFY subcommand, press CONTROL Y before RETURN. To cancel a MODIFY command for all lines of a range not yet modified, press CONTROL Y after EDIT/3000 displays the line to be modified. EDIT/3000 then proceeds to the next range (if any) in rangelist or terminates the MODIFY command if this was the last (or only) range in rangelist. Lines already modified remain modified and all other lines remain unchanged. The MODIFY command operates only on text within the SET LEFT, SET RIGHT options in effect. (See paragraph 3-92 for a discussion of the SET command.) Only one subcommand may be used to modify a line each time it is displayed, with this exception: an I (insert) subcommand can follow a D (delete) or an I can be used as the second D in a range of Ds. For example,
As you recall, if the ampersand ( &; ) is used as the last character in a line, EDIT/3000 interprets this as meaning that the line is to be continued. Thus, when an ampersand is to be entered as the last character in a line to be modified with a REPLACE or INSERT subcommand, you must enter a blank character after the ampersand. Several variations of the MODIFY command are shown in the following examples.
The DELETE (D) subcommand causes any character above the D (or a string of Ds or two Ds with blank characters between) to be deleted. In the example, the blank character between "HP" and "3000" is deleted by moving the cursor under the blank character and typing D, then the entire string "HP 3000" is deleted by the D, a string of blanks, and another D.
The REPLACE (R) subcommand replaces characters starting with the character directly above the R with new characters entered from the INPUT file. In the example, the characters "HP3000" are replaced by "HEWLETT-PACKARD". The INSERT subcommand (1) is used to insert the characters "3000" after "HEWLETT-PACKARD". The I is positioned directly under the character where the inserted information is to begin.
The DELETE (D) and INSERT (I) subcommands can be used on the same line. The I can be used to insert characters after a D (or a range of Ds), or the I can be used as the last D in a range of Ds. after the I will be inserted in the line after the last deleted character. In the example, the characters "HEWLETT-PACKARD" are deleted by the range of Ds and the characters "HP" then are inserted with the I subcommand.
In the following example, an & is inserted as the last character and RETURN is pressed. EDIT/3000 interprets this as a continuation character and the command LIST 3 is added to the end of line 3. The second part of the example deletes the characters "LIST 3" and inserts an & and a blank character. Now EDIT/3000 interprets the modification correctly.
|
|