Define Multiple Macros [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Define Multiple Macros
Purpose
Defines several macros from contiguous lines of text.
Default Syntax
ESC z
Description
This command enables you to define several macros that you have created
on separate, adjacent lines within a file. The command provides a manual
approach for defining macros, whereas the Begin Capture and Capture Macro
commands provide an automated, interactive approach for defining macros.
Command Process
In order for this command to function, you move the cursor to the first
line of the macro group and execute the command. HP EDIT responds by
deleting the macros from the screen and storing them for subsequent
execution. You could then use either the Execute Macro command or the Go
To Macro command to execute each macro.
HP EDIT defines only the macros that conform to correct macro syntax. If
HP EDIT encounters incorrect macro syntax within the series, it defines
only the correctly entered macros and stops defining when it reaches the
incorrectly entered macro. For instance, if you enter ten macros on ten
separate lines and the fifth macro contains incorrect syntax, HP EDIT
defines only the first four macros when you execute the command.
Command Applications
This command is useful for the following applications:
* Creating several new macros and defining them together
* Storing and loading related macros without saving editing options
and key assignments in a configuration file
* Editing several existing macros and then redefining them together
* Creating a macro several lines long using several "submacros"
To create several new macros, you first insert a new line and then type
in the first macro. You then type in the remaining macros on separate,
adjacent lines before subsequently executing this command.
To load and define several macros stored in a file, you first insert the
file into the text using the Join File command. Then you execute this
command to define the macros.
To edit several existing macros, you either insert each macro into your
text individually with the Insert Macro command, or you insert all macros
into text as a group with the Insert All Macros command. You then edit
the macros before subsequently executing this command.
To create a chain of macros, you create individual macros; each macro
performs a portion of the desired task. You chain the macros by having
each macro go to or call the next macro. An example of chaining appears
in the Examples section.
Macro Syntax
Refer to the Define Macro command for complete syntax information.
Procedure
To define several macros from text:
1. Insert a new line in text by executing the Insert Line (I)
command.
2. Type in the first macro beginning at the cursor position at the
far left column, using the appropriate macro syntax.
3. Press Return after you have finished typing the first macro to
move the cursor to the beginning of a new line. Type in the
second macro and all subsequent macros, pressing Return at the end
of each macro. When you have finished typing in all macros,
proceed to step 4.
4. Press / and Return to exit Text Entry mode and enter Command mode.
5. Move the cursor to the first macro of the group.
6. Press ESC, then press the z key. HP EDIT deletes the macros from
the screen and stores them for subsequent execution. HP EDIT also
displays X macros defined on the message line, where X represents
the number of macros on the screen when you executed the command.
Examples
To collectively define three separate non-preemptive macros:
1. Insert a new line in text by executing the Insert Line (I)
command.
2. Type the following macros beginning at the first column of each
line:
mA=f^^ *$^m/
mB=;Begin:/^m
mE=Iend;/^mQ
3. Press / and Return to exit Text Entry mode and enter Command mode.
4. Move the cursor to the first macro of the group.
5. Press ESC, then press the z key. HP EDIT deletes the macros from
the screen and stores them for subsequent execution. HP EDIT also
displays 3 macros defined on the message line.
To define a chain of macros that appends three lines of text:
1. Insert a new line in text by executing the Insert Line (I)
command.
2. Type in the following macros on three separate lines:
ma=AThis line will be connected to/^mMb
mb=Athis line and the next by/^mMc
mc=Achaining each line./^mQ
3. Press / and Return to exit Text Entry mode and enter Command mode.
4. Move the cursor to the first macro of the group.
5. Press ESC, then press the z key. HP EDIT deletes the chain of
macros from the screen and stores them for subsequent execution.
HP EDIT also displays 3 macros defined on the message line.
Related Commands
Begin Capture
Capture Macro
Define Macro
Delete All Macros
Delete Macro
Execute Macro
Go To Macro
Insert All Macros
Insert Macro
Quit Macro
Show Macros
Use Current Key Assignment
MPE/iX 5.0 Documentation