Define Replace Pattern From Macro [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Define Replace Pattern From Macro
Purpose
Enables you to define a replace pattern within an executing macro.
Default Syntax
$=
Description
This command, when executed within a macro, suspends a currently
executing macro and enables you to define a replace pattern by responding
to a prompt.
Command Process
When you execute the macro, HP EDIT temporarily suspends macro execution
and prompts you for replacement text of up to 80 characters. After you
have typed in the replacement text and pressed the Return key, HP EDIT
resumes execution of the macro.
Syntax Considerations
[REV DEL]
Refer to the Define Macro command for information about required syntax.
Since the standard Meta key is displayed as ^[ when inserted in a macro,
HP EDIT provides the dollar sign ($) as a substitute for the Meta key.
Consequently, you should use the recommended syntax of $= within a macro.
Procedure
To execute this command within a macro:
1. Construct the macro containing this command using proper macro
syntax. Refer to the Define Macro command for information about
constructing macros. If the macro is preemptive, skip to Step 3.
2. Execute the macro by pressing the m key. HP EDIT displays Specify
macroname on the message line.
3. Type the macro name as specified in the macro. HP EDIT executes
the macro and pauses for your input.
4. Provide the input and then press Return. HP EDIT resumes
execution of the macro.
Example
To construct, define, and execute a macro that pauses for you to define a
replace pattern:
1. Insert a new line in text by executing the Insert Line (I)
command.
2. Type in the following macro beginning at the cursor position:
mR$=ASee message line../^m$=A..Replace pattern defined/^m
3. Press / and Return to exit Text Entry mode and enter Command mode.
4. Execute the Define Macro (z) command. HP EDIT removes the macro
from the screen and stores it for subsequent execution. HP EDIT
also displays Macro defined on the message line.
5. Issue the Execute Macro (m) command. HP EDIT displays Specify
macroname on the message line.
6. Press ESC. HP EDIT displays Specify meta-macroname on the message
line.
7. Press the R key. HP EDIT prints See message line... on the
screen at the cursor position and displays the following prompt on
the message line:
Replace with () :
8. Specify the replace pattern and press Return. HP EDIT erases the
prompt, stores the replace pattern, and concludes the macro
execution by printing a second line of text below the first as
shown:
See message line..
..Replace pattern defined
Related Commands
Append Line From Macro
Append To Character From Macro
Append To End Of Line From Macro
Append To Word From Macro
Define Replace Pattern
Define Search Pattern From Macro
Insert Character From Macro
Insert Line From Macro
Replace Character From Macro
Replace Line From Macro
Replace Word From Macro
Overwrite From Macro
MPE/iX 5.0 Documentation