HP 3000 Manuals

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


HP EDIT Reference Manual

Capture Macro 

Purpose 

Defines a macro using recorded user input.

Default Syntax 

ESC )

Description 

This command, along with the Begin Capture command, enables you to define
a macro from keyboard input.

Command Process 

The Begin Capture command initiates the macro definition process by
enabling you to create the desired macro text.  The Capture Macro command
completes the macro definition process by prompting for information that
HP EDIT requires to transform your keyed text into a macro.  You provide
the following information during the sequence of prompts:

   *   Key to be assigned as a macro name

   *   Whether the key is to be prefixed

   *   Whether the key preempts the same key assigned to a command

After responding to the prompts, HP EDIT indicates that the macro
assigned to the specified key is defined.  The specified key is referred
to as the macro name.

Saving The Macro 

Note that a newly defined macro only exists for the current session.  The
macro is not executable within other active child or parent sessions.  To
use the macro in other sessions, you must first save the macro to a
configuration file using the Save Config File command.  You could either
save the macro to the EDCONFIG default configuration file or to another
file name.  You could then read in the configuration file using the Load
Config File command for subsequent sessions. 

Procedure 

To define a macro using recorded input: 

   1.  Press ESC, then press the ) key.  HP EDIT displays Assign macro to 
       which key?  on the message line.

   2.  Press the key that you want to assign to the macro.  HP EDIT
       displays Is key prefixed with Meta?  on the message line.

   3.  Press the y key if you want to prefix the assigned key with the
       Meta key, or press the n key if you do not want to prefix the
       assigned key with the Meta key.  HP EDIT responds to your reply by
       displaying Is macro preemptive?  on the message line.

   4.  Press the y key to reply yes, or press the n key to reply no.  If
       you reply yes, HP EDIT automatically executes this macro when you
       subsequently press the assigned key.  If you reply no, HP EDIT
       does not execute this macro when you subsequently press the
       assigned key.  Instead, you must execute the macro using either
       the Execute Macro (m) command or the Go To Macro (M) command.

       HP EDIT responds to your reply by displaying Macro defined:  X on
       the message line, where X represents the assigned key, which is
       the macro name.

Example 

To define a macro assigned to the s key that splits a line at the cursor 
position: 

   1.  Execute the Begin Capture command by pressing ESC, then pressing
       the ( key.  HP EDIT displays the following prompt on the message
       line:

            Capture activated

   2.  Execute the Insert Character (i) command to enter Text Entry mode.

   3.  Press Return to split the line at the current cursor position.

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

   5.  Execute the Capture Macro command by pressing ESC, then pressing
       the ) key.  HP EDIT displays the following prompt on the message
       line:

             Assign macro to which key? _

   6.  Press the s key.  HP EDIT displays the following prompt on the
       message line:

            Is key prefixed with Meta? _

   7.  Press the n key to reply no.  HP EDIT displays the following
       prompt on the message line:

            Is macro preemptive? _

   8.  Press the n key to reply no.  If you reply yes instead, HP EDIT
       automatically executes this macro whenever you press the s key,
       rather than execute the Scroll Forward (s) command.  Replying no
       to the prompt necessitates using the Execute Macro (m) command or
       the Go To Macro (M) command to execute the macro.

       After you reply to the prompt, HP EDIT returns the cursor to its
       former position on the macro text line and displays the following
       message, indicating that the s key is now assigned to this macro:

     Macro defined: s

Related Commands 

       Begin Capture
       Capture File



MPE/iX 5.0 Documentation