Append To Word From Macro [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Append To Word From Macro
Purpose
Enables you to add text after the current word within an executing macro.
Default Syntax
$^a
Description
This command, when executed within a macro, suspends a currently
executing macro and enables you to add text starting after the current
word.
Command Process
When the macro pauses for your input, HP EDIT moves the cursor one column
beyond the current word, enabling you to add unlimited text. You can add
subsequent lines by pressing Return without preceding it with the / key.
When you have finished adding text, pressing / and Return returns you to
Command mode. After you have returned to Command mode, HP EDIT resumes
execution of the macro.
Syntax Considerations
In order to use this command within a macro, you must properly construct
the macro using correct syntax. Refer to the Define Macro command for
information about required syntax.
Since the standard Meta key (ESC) is displayed as ^[ when inserted in a
macro, HP EDIT provides the dollar sign ($) as an alternate Meta key.
Consequently, you should use the recommended syntax of $^a within a
macro.
Word Definition
HP EDIT enables you to specify the type of characters that constitute an
HP EDIT word. There are four possible word definitions. You can specify
a definition other than the default value by changing the value of the
Word Category parameter from the Set Options screen.
The following word definition options are available:
[a-zA-Z0-9_'-] Words consist of upper and lowercase letters,
digits, underscores, apostrophes, and hyphens.
Words are separated by spaces and any
non-alphanumeric characters besides the underscore,
apostrophe, or hyphen. This is the default
definition.
[a-zA-Z0-9_] Words consist of upper and lowercase letters,
digits and underscores. Words are separated by
spaces and any non-alphanumeric characters besides
the underscore.
[a-zA-Z0-9] Words consists of upper and lowercase letters as
well as digits. Words are separated by spaces and
any non-alphanumeric characters.
[~ ] Words consist of any non-space characters separated
by spaces.
Procedure
To execute this command within a macro:
1. Construct the macro containing the 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 / and Return to return to Command
mode. HP EDIT resumes execution of the macro.
Example
To construct, define, and execute a macro that pauses for you to append
text after the current word:
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:
mw=AAppend to this/^mb$^A; to complete the text./^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.
5. Press the m key. HP EDIT displays the following prompt on the
message line:
Specify macroname
6. Press the w key. HP EDIT executes the macro and waits for your
input after the following text appears at your terminal:
Append to this_
7. Press the spacebar and type word as shown:
Append to this word_
8. Press / and Return to return to Command mode. HP EDIT resumes and
concludes the macro execution and appends to complete the text.
following your input as shown:
Append to this word to complete the text._
Related Commands
Append Line From Macro
Append To Character From Macro
Append To End Of Line From Macro
Append Word
Define Replace Pattern From Macro
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