Creating and Using Prestored Commands
If you are a frequent user of the Screen Editor, and especially if you edit the same type of files often, you might find it productive to use the * (Prestore Record) and CTRL+P (Prestore Run) commands.
The * command allows you to capture and store a sequence of commands and execute them either immediately or at a later time. You can execute a long series of commands as a single step, resulting in a considerable saving of time, effort and keystrokes.
Record
Use the * command to capture and store the command sequence:
-
Press the asterisk (*) to start recording.
-
Type the desired sequence of commands.
-
Press the asterisk (*) to end the recording of commands.
-
Save the command sequence if it is to be used again. Saved command sequences are placed in an item in the current file with the item-id suffixed with
-PS
.
Editing
You can further edit any prestored command item in a -PS item with either the Screen Editor or the Line Editor.
Run
A prestored command sequence can be executed at any time by pressing CTRL+P. The Status/Command Line prompts for the item-id of the -PS item.
Deleting
After developing a program or completing some other long series of editing tasks, you might have a file with a large number of -PS items that you no longer need. The only way to delete them is from TCL. For example, if you have a large number of '-PS' items in a file named TEST and you want to delete them all, you could enter the following:
:SELECT TEST EQ '[-PS'
2 ITEMS SELECTED. >DELETE TEST
All items ending with '-PS' are then deleted from TEST.