HP 3000 Manuals

Insert Character From Macro [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation


HP EDIT Reference Manual

Insert Character From Macro 

Purpose 

Enables you to insert text at the cursor position within an executing
macro.

Default Syntax 

$i

Description 

This command, when executed within a macro, suspends a currently
executing macro and enables you to insert text starting at the current
character.

Command Process 

When the macro pauses for your input, HP EDIT enables you to insert text
beginning at the cursor position.  All of the original text beginning at
the insert location shifts to the right when you enter text.  If there is
insufficient space to insert text, HP EDIT wraps the excess text onto the
next line after you press Return.

When you have finished inserting 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 $i 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.  Skip to Step 3 if this macro is preemptive
       (preempts the command to which the key is ordinarily assigned).

   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 insert
text before the current character: 

   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:

            mi=AInsert a charactr/^m^H$i; to correct the text./^m

       Note that the ^H signifies a backspace.

   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 i key.  HP EDIT executes the macro and waits for your
       input after the following text appears:

            Insert a charactr

   7.  Type the letter e as shown:

            Insert a character

   8.  Press / and Return to return to Command mode.  HP EDIT resumes and
       concludes the macro execution and appends to correct the text. 
       following your input as shown:

            Insert a character to correct the text.

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 From Macro
       Define Search Pattern From Macro
       Insert Character
       Insert Line From Macro
       Replace Character From Macro
       Replace Line From Macro
       Replace Word From Macro
       Overwrite From Macro



MPE/iX 5.0 Documentation