|
|
QUERY/V Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 QUERY/V COMMANDSALTER |
|
Inserts, replaces, and deletes lines of a procedure stored in the current Proc-file. When you enter the ALTER command, QUERY prompts you for insert, replace, and delete statements by printing >>. Each statement operates on a line or range of lines in the procedure. In the statement descriptions that follow, m is the first line number in the range, and n is the last line number. n must always be greater than or equal to m, and m must be greater than or equal to 1. Neither m nor n can exceed the total number of lines in the procedure. Once you enter the ALTER command, you must do your editing sequentially from lower numbered lines to higher numbered lines. You cannot go back to a line which precedes the ones you are currently editing without exiting the ALTER command and entering another ALTER command. This technique is illustrated in the examples which follow. If an error occurs after a statement is entered, an error message is printed and QUERY prompts you for another ALTER statement. You can abort the command at any time by entering CONTROL Y. If you do this, the procedure will remain unchanged. Always terminate the command with /E if you want to save the results of your changes. You can use one of four statements in response to an ALTER prompt: Insert, Replace, Delete, and End. Lines which are added or changed are not checked for correct syntax until the procedure is executed. Similarly, if line deletion causes a command to have incorrect syntax, it not will be detected until the procedure is executed. Inserts lines into the procedure. QUERY prompts for each statement and line with >>.
The lines which follow the insert statement are inserted into the procedure following line number m. You cannot insert lines in front of the first procedure line. To indicate you do not want to insert mores lines, enter a slash followed by another ALTER statement.
The example above changes the procedure FIND1 from:
Deletes the specified line or range of lines and replaces them with the lines following the replace statement. QUERY prompts for each statement and line with >>.
The example above changes the procedure UPDATE1 from:
Deletes the specified line or range of lines. QUERY prompts for each statement with >>.
If you try to delete all the lines in the procedure, an error message is printed. To delete the entire procedure, use the DESTROY command.
QUERY continues to prompt you for insert, delete, or replace statements until you enter /E. If the ALTER command is terminated using CONTROL Y, the entire command is ignored and the procedure remains in its original state. To save your changes, you must terminate the ALTER command with /E.
The following is an example of using the ALTER command with all four statements. The DISPLAY command can be used to examine the procedure and the results of the ALTER command.
|
|