MAILHELP.HLB  —  DEFINE
    Defines a key to execute a command. This enables you to press a
    key to enter a command instead of typing the command name.

    Format

      DEFINE/KEY  key-name "string"

1  –  Parameters

 key-name

    Specifies the name of the key you are defining. Use the following
    key names when defining keys:

    Key Name       VT100          VT52           LK201

    PF1            PF1            red key        PF1
    PF2            PF2            blue key       PF2
    PF3            PF3            black key      PF3
    PF4            PF4            -              PF4
    KP0, KP1-KP9   keypad 0-9     keypad 0-9     keypad 0-9
    Period         period key     period key     period key
    Comma          comma key      comma key      comma key
    Minus          minus key      minus key      minus key
    Enter          ENTER key      ENTER key      ENTER key
    E1,E2          -              -              Find,Insert Here
    E3,E4          -              -              Remove,Select
    E5             -              -              Previous Screen
    E6             -              -              Next Screen
    Help,Do        -              -              Help(15), Do(16)
    F17-F20        -              -              Function Keys

                                   NOTE

       You cannot redefine the arrow keys or the function keys F1
       to F14.

 "string"

    Specifies the string you want entered when you press the defined
    key. "String" can be a Mail command, for example, DIRECTORY or
    SET FILE.

2  –  Qualifiers

2.1    /ECHO

       /ECHO
       /NOECHO

    Specifies whether the command line is visible on the screen after
    you press the defined key. You cannot define a key specifying
    both the /NOECHO and /NOTERMINATE qualifiers. The default
    qualifier is /ECHO.

2.2    /IF_STATE

       /IF_STATE=state_list
       /NOIF_STATE

    Specifies a list of states, any one of which must be set in order
    to enable the specified key definition. If you omit or negate
    this qualifier, the current state prevails.

    States are used to increase the number of key definitions
    available on your terminal. The same key can be assigned any
    number of definitions as long as each definition is associated
    with a different state. State names can be any alphanumeric
    string.

2.3    /LOCK_STATE

       /LOCK_STATE
       /NOLOCK_STATE

    Retains the state specified by the /SET_STATE qualifier until
    you use the /SET_STATE qualifier again to change it. The default
    qualifier is /NOLOCK_STATE.

    States are used to increase the number of key definitions
    available on your terminal. The same key can be assigned any
    number of definitions as long as each definition is associated
    with a different state. State names can be any alphanumeric
    string.

2.4    /LOG

       /LOG
       /NOLOG

    Specifies whether informational messages are displayed. These
    messages signal successfully created key definitions. The default
    qualifier is /LOG.

2.5    /SET_STATE

       /SET_STATE=state
       /NOSET_STATE

    Associates a state with the key you are defining. A state name
    can be any alphanumeric string. If you omit or negate this
    qualifier, the current state remains unchanged. You cannot define
    a key specifying both the /SET_STATE and /TERMINATE qualifiers.

    States are used to increase the number of key definitions
    available on your terminal. The same key can be assigned any
    number of definitions as long as each definition is associated
    with a different state.

2.6    /TERMINATE

       /TERMINATE
       /NOTERMINATE

    Determines whether the specified command string executes when
    you press the key. When you use the /NOTERMINATE qualifier, you
    must press the Return key to execute the command string. You
    cannot define a key specifying both the /SET_STATE and /TERMINATE
    qualifiers.

3  –  Examples

    1.MAIL> DEFINE/KEY PF1 "DIRECTORY"

      This example shows how to define the keypad key PF1 as the
      DIRECTORY command. To enter the DIRECTORY command, press PF1
      followed by the Return key.

    2.MAIL> DEFINE/KEY KP6 "EDIT" /TERMINATE

      This example shows how to define the keypad key 6 (KP6) as the
      EDIT command. The /TERMINATE qualifier causes the EDIT command
      to execute when you press KP6; you do not have to press the
      Return key.

    3.MAIL> DEFINE/KEY PF2 "SET "/SET_STATE=ALTERED

      MAIL> DEFINE/KEY PF3 "FILE" /IF_STATE=ALTERED /TERMINATE

      In this example, the PF2 key is defined as the SET command,
      with the state name ALTERED. Then, the PF3 key is defined to
      output the string FILE when the state ALTERED is specified.

      The /TERMINATE qualifier is used to end the command line. When
      you specify the /TERMINATE qualifier, you can avoid pressing
      the Return key to execute the command line. After you define
      PF2 and PF3, you can use them together. Press PF2 to produce
      the first half of the command line (SET) and press PF3 to
      finish the command line (FILE).

    4.MAIL> DEFINE/KEY PF4 "SET " /SET_STATE=ALTERED
      MAIL> DEFINE/KEY KP7 "FILE" /TERMINATE /IF_STATE=ALTERED
      MAIL> DEFINE/KEY KP8 "FORWARD" /TERMINATE /IF_STATE=ALTERED
      MAIL> DEFINE/KEY KP9 "WASTEBASKET" /TERMINATE /IF_STATE=ALTERED

      This example shows how to define four different keys and
      associate them with a state named ALTERED:

      1. The first definition defines the key PF4 as the SET command
         and associates this key with a state named ALTERED.

      2. The second definition defines the keypad key 7 as "FILE" and
         makes it dependent on a state named ALTERED. When you press
         PF4 followed by keypad key 7, Mail executes the SET FILE
         command.

      3. The third definition defines keypad key 8 as "FORWARD" and
         also makes it dependent on the ALTERED state. When you press
         PF4 followed by keypad key 8, Mail executes the SET FORWARD
         command.

      4. The fourth definition defines keypad key 9 as "WASTEBASKET"
         and also makes it dependent on the ALTERED state. When you
         press PF4 followed by keypad key 9, Mail executes the SET
         WASTEBASKET command.
Close Help