Go To Macro [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Go To Macro
Purpose
Runs a macro at the current input level.
Default Syntax
[n]M
where n is a count that represents the number of times you want the macro
to execute. The default value of n is 1.
Description
This command executes a preemptive or non-preemptive macro. In order to
execute a non-preemptive macro or preemptive macro from within a macro,
you must use either this command or the Execute Macro command. A key
assigned to a non-preemptive macro does not preempt the same key assigned
to an HP EDIT command. Consequently, the same key can be assigned twice
for different purposes.
Command Application
This command provides a method of executing macros that consist of text
longer than one line. You can execute several macros as a single macro
by chaining them together, enabling each "submacro" to go to the next
macro in the chain.
This command also enables a macro to execute itself (in a loop) without
running out of subroutine levels. If you use this approach, avoid
defining infinite loops that never terminate.
Command Process
When you execute the command, HP EDIT prompts for the macro name, which
is the key assigned to the macro. If the Meta key precedes the assigned
key and you press the Meta key (ESC) in response to this prompt, HP EDIT
prompts a second time for the Meta macro name. If you specify a valid
macro name, HP EDIT executes the macro. If you specify an undefined
macro name, HP EDIT displays Macro does not exist on the message line.
If you want to abort a running macro after you execute this command,
press CTRL y. If you want to cancel the effect of a macro that has just
finished executing, use either Undo Last Command or the Undo Sequentially
command.
Procedure
To execute a macro one or more times:
1. Type a number greater than 1 as the count if you want to execute
the macro more than once.
2. Press the M key. HP EDIT displays Specify macroname on the
message line. If the key assigned to the macro is prefixed by the
Meta key, proceed to step 2. If not, skip to step 3.
3. Press ESC. HP EDIT displays Specify meta-macroname on the message
line.
4. Press the key assigned to the macro that you want to execute. HP
EDIT responds to a valid key entry by executing the corresponding
macro.
Example
To construct, define, and execute 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 chain of 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 and execute the
Define Multiple Macros (ESC) z command. HP EDIT deletes the three
macros from the screen and stores them for subsequent execution.
HP EDIT also displays the following message:
3 macros defined
5. Press the M key. HP EDIT displays the following prompt on the
message line:
Specify macroname
6. Press the a key. HP EDIT executes the three macros as shown:
This line will be connected to
this line and the next by
chaining each line.
Related Commands
Begin Capture
Capture Macro
Define Macro
Define Multiple Macros
Delete All Macros
Delete Macro
Execute Macro
Insert All Macros
Insert Macro
Quit Macro
Show Macros
Use Current Key Assignment
MPE/iX 5.0 Documentation