Keep Text [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Keep Text
Purpose
Saves the current text to a specified file.
Default Syntax
[n] k
where n is a count that represents the number of lines you want to save.
If you do not specify a value for n, HP EDIT saves the entire file.
Description
This command saves some or all of the current text to either the current
file name or a file name you specify.
Command Process
When you execute the command, HP EDIT temporarily suspends the editing
session and displays a message stating that HP EDIT will save the edited
text to the current file name.
You can respond to the prompt by saving the text to the current file
name, or you can specify another existent or non-existent file name.
Saving a file to another name enables you to create a new file from an
existing file, which has a similar effect as using the Change Filename
command, except that the Keep Text command saves text when you rename the
file, whereas the Change Filename command does not.
If you respond to the prompt by specifying a non-existent file name, HP
EDIT creates a file with this name without overwriting the original file.
If you specify an existing file name instead, HP EDIT displays the prompt
Purge the old file? on the message line. If you reply y for yes, HP
EDIT responds by writing over the existing file. If you reply n for no,
HP EDIT cancels the operation.
After you have saved the text by pressing Return, HP EDIT returns to the
editing session and displays a message indicating the number of lines
saved.
Partial Keeps
You do not have to save the entire file when you execute this command.
You can save part of the file to another file name by first typing a
count representing the number of lines you want to save, [REV BEG]or by
selecting a block of text,[REV END] then executing the command. HP EDIT
then prompts you to provide the name of the file to which you want to
save the partial text of the current file. After providing a file name,
HP EDIT saves the text to the specified file name.
Note that when you keep a portion of text from the current session and
save it to another file, the file name of the session is not changed. To
change the file name, you must keep the entire file, or use either the
Change Filename or Change Filename From Text command.
Automatic Keep Function
You can activate an automatic keep function (Autokeep) by specifying a
value for the Autokeep Interval field using the Set Options command.
Although HP EDIT automatically records changes in a recovery file,
Autokeep provides an additional method for handling unexpected system
failures.
When an Autokeep occurs, HP EDIT saves the entire file to the current
file name without prompting for keyboard input. The frequency of
automatic keeps depends on the value specified in the Autokeep Interval
field. The value represents the number of text-altering commands entered
before HP EDIT automatically saves the file. For instance, if you
specify 25, which is a typical value for the field, HP EDIT automatically
keeps the file after you have entered 25 text-altering commands.
The default value of the Autokeep Interval field is zero. This value
disables the Autokeep function. The maximum permissible value is 10,000
commands.
Procedures
To keep changed text to the same file:
1. Press the k key, or press the File Commands function key, followed
by the Keep Text function key. HP EDIT suspends the session and
asks you to either save the file, cancel the save process, or
enter a different file name.
2. Press Return to keep text to the current file name, or press CTRL
y to cancel the save process, or type over the highlighted name
with a new file name and then press Return. HP EDIT momentarily
displays a message indicating that it is keeping the file. HP
EDIT then returns you to your session and displays a message
indicating the number of lines saved to the specified file name.
NOTE Do not use the cursor keys to edit the specified file name. If you
edit the displayed file name, type over all of the characters when
specifying another name. Typing over only some of the characters
does not preserve the remaining characters.
To keep a portion of text to another file:
1. Type a count representing the number of lines, beginning at the
current cursor position, that you want to save to another file.
2. Press the k key, or press the File Commands function key, followed
by the Keep Text function key. HP EDIT displays a prompt asking
you to enter a file name or cancel the save process.
3. Enter the file name or press CTRL y to cancel the save process.
If you enter a file name, HP EDIT returns you to your session and
displays the number of lines saved to the specified file name.
Examples
To save changed text to a file named NEW:
1. Press the k key. HP EDIT displays the following message:
Type Return to save file, CTRL-Y to cancel, or enter a different filename
Saving text to file OLD
2. Type the file name new beginning at the cursor position. HP EDIT
displays the following message:
Keeping file (unnumbered)
Note that the type of file shown in parenthesis depends on whether
the New File Type parameter (Set Options screen) is unnumbered,
standard-numbered, variable, or COBOL-numbered. HP EDIT then
returns to the current editing session and displays the following
message:
X lines kept to NEW
where X represents the number of saved changed lines.
To save 10 lines of text to a file named PARTIAL:
1. Move the cursor to the top line of the group of lines you want to
save.
2. Type a count representing the group of lines to be saved. HP EDIT
displays the count on the message line.
3. Press the k key. HP EDIT displays the following message:
Enter a filename or press CTRL-Y to cancel
Save 10 lines of text to file
4. Type the file name partial beginning at the cursor position. HP
EDIT momentarily displays the following message:
Keeping file (unnumbered)
Note that the type of file shown in parenthesis depends on whether
the file is unnumbered, standard-numbered, variable, or
COBOL-numbered. HP EDIT then returns to the current editing
session and displays the following message:
10 lines kept to PARTIAL
Related Commands
Change Filename
Exit
MPE/iX 5.0 Documentation