HP 3000 Manuals

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


HP EDIT Reference Manual

Insert Macro 

Purpose 

Inserts a macro definition above the cursor line.

Default Syntax 

Z

Description 

This command inserts a specified macro above the cursor line, enabling
you to edit and then redefine the macro.  For instance, you may want to
modify an existing macro by adding or deleting text, rather than deleting
the macro and rekeying the entire text.  You would first execute this
command to insert the macro, then you would edit it as desired.  When
finished, you would execute the Define Macro command to redefine the
altered macro.

When you execute the command, HP EDIT asks you to specify a macro name.
The macro name is the key to which a macro is assigned.  If the key you
press is assigned to a macro, HP EDIT inserts the macro above the current
cursor position in your file.  If the specified key is invalid, HP EDIT
displays Macro X does not exist in which X represents the invalid key
specified.

Procedure 

To insert a specified macro above the current line: 

   1.  Press the Z 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.

   2.  Press ESC. HP EDIT displays Specify meta-macroname on the message
       line.

   3.  Press the key assigned to the macro that you want to insert.  HP
       EDIT responds to a valid key entry by inserting the corresponding
       macro above the cursor line.

Example 

To edit a macro assigned to the H key that appends a line containing the 
word Hello when executed: 

   1.  Press the Z key.  HP EDIT displays the following prompt on the
       message line:

            Specify macroname

   2.  Press the H key.  HP EDIT inserts the following macro above the
       current line:

            mH=AHello/^m

   3.  Move the cursor to the slash (/), then execute the Insert
       Character (i) command to access Text Entry mode.

   4.  Type there!  beginning at the cursor position as shown:

            mH=AHello there!/^m

   5.  Press / and Return to return to Command mode.

   6.  Redefine this modified macro by executing the Define Macro (z)
       command.  HP EDIT deletes the macro from the screen, stores it as
       an executable macro, and displays Macro defined on the message
       line.

   7.  Verify the accuracy of the redefined macro by executing the macro
       using the Execute Macro (m) command.  If steps 3 through 5 were
       performed correctly, HP EDIT inserts the following output below
       the current cursor line:

            Hello there!

Related Commands 

       Begin Capture
       Capture Macro
       Define Macro
       Define Multiple Macros
       Delete All Macros
       Delete Macro
       Execute Macro
       Go To Macro
       Insert All Macros
       Quit Macro
       Show Macros
       Use Current Key Assignment



MPE/iX 5.0 Documentation