Bristle Software VAX/VMS Tips

This page is offered as a service of Bristle Software, Inc.  New tips are sent to an associated mailing list when they are posted here.  Please send comments, corrections, any tips you'd like to contribute, or requests to be added to the mailing list, to tips@bristle.com.

Table of Contents:

  1. EDT Editor Tips
    1. Specify EDT startup file via EDTINI logical name
    2. Use EXT in DEFINE KEY to run line mode commands
    3. End DEFINE KEY with dot for immediate action
    4. Use parentheses around commands in DEFINE KEY
    5. Use ?'prompt' in DEFINE KEY to prompt the user
    6. Use ?*'prompt' in DEFINE KEY to support Enter
    7. Chain command files together with SET COMMAND

Details of Tips:

  1. EDT Editor Tips

    1. Specify EDT startup file via EDTINI logical name

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      At startup, EDT looks for a file named by the logical name EDTINI, loads that file,and executes the EDT line mode commands it contains.  You can use this file to define keys, set modes of the editor, etc.  If the logical name EDTINI is not defined, it looks for the file EDTINI.EDT in the current working directory instead.

      --Fred

    2. Use EXT in DEFINE KEY to run line mode commands

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      When defining a key in EDT, you typically specify the desired behavior of the key via the "nokeypad" commands.  However, you can use a line mode command by prefixing it with the EXT nokeypad command.  For example, a typical key definition looks like:

      	DEFINE KEY GOLD D AS "DL UNDL UNDL."

      It use the DL and UNDL commands to delete the current line and then insert it twice.   It duplicates the current line.  The following line defines the key Gold W to write the current buffer to a file named TEMP.TMP, via the line mode WRITE command:

      	DEFINE KEY GOLD W AS "EXT WRITE TEMP.TMP."

      --Fred

    3. End DEFINE KEY with dot for immediate action

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      When defining a key in EDT, end the definition with a dot (period) if you want the command to execute immediately when the key is hit.   Otherwise, the user has to hit the key and then hit Enter.  For example:

      	DEFINE KEY GOLD D AS "DL UNDL UNDL."

      --Fred

    4. Use parentheses around commands in DEFINE KEY

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      When defining a key in EDT, enclose the entire definition (except the dot) in parentheses if you want the user to be able to specify a repeat count.  To specify a repeat count, the user hits the Gold key, then types a number, then hits your defined key.   This causes the key definition to be executed the specified number of times.   However, if you fail to enclose your definition in parentheses, the repeat count applies only to the first command in the definition.  For example, a repeat count of 3 on the following key definition causes 3 lines to be deleted and the last line to be inserted twice:

      	DEFINE KEY GOLD D AS "DL UNDL UNDL."

      However, a repeat count of 3 on the following key definition has the desired effect of making 3 copies of the current line:

      	DEFINE KEY GOLD D AS "(DL UNDL UNDL)."

      --Fred

    5. Use ?'prompt' in DEFINE KEY to prompt the user

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      When defining a key in EDT, use ?'prompt' to prompt the user for info to be inserted into the key definition.  For example, the following line defines the key Gold W to write the current buffer to a file named TEMP.TMP:

      	DEFINE KEY GOLD W AS "EXT WRITE TEMP.TMP."

      but the following line defines it to write to a user-specified file:

      	DEFINE KEY GOLD W AS "EXT WRITE ?'Write filename: '."

      It prompts the user with the string "Write filename: ", then inserts the user's response into the command in place of the prompt, and executes the command.

      --Fred

    6. Use ?*'prompt' in DEFINE KEY to support Enter

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      When defining a key in EDT, use an asterisk ("*") after the question mark to support the use of the regular Enter key, not only the keypad Enter key.   For example, the default definition of Gold 7 requires the user to hit the keypad Enter key after typing a command:

      	DEFINE KEY GOLD 7 AS "EXT ?'Command: '."

      but the following line allows the use of the regular Enter key:

      	DEFINE KEY GOLD 7 AS "EXT ?*'Command: '."

      --Fred

    7. Chain command files together with SET COMMAND

      Last Updated: 12/6/1998
      Applies to:  VMS 4.3+

      You can chain multiple EDT command files together with the SET COMMAND command.  This is useful, for example, if you want your own EDTINI customizations to be in effect for your edit sessions, but don't want to lose the customizations provided by the standard company-wide EDTINI file at your company.  Simply define the EDTINI logical name to refer to your file and add a line like the following to the end of your file:

      	SET COMMAND SYS$SYSTEM:EDTINI.EDT

      Assuming that your company-wide EDTINI file is called SYS$SYSTEM:EDTINI.EDT, this causes both files to execute as EDT starts up.

      --Fred

©Copyright 1998-2021, Bristle Software, Inc.  All rights reserved