SET SYNONYM

Format 1:


1 ? SET  SYNonym
1 ON
1 OFF

Format 2:


1 ? SET  SYNonym?  LINEND char  newname
1 ? n oldname

Format 3:


1 ? SET  SYNonym?  LINEND char  newname?  n?  + 
2.1 &
2.1 &/
2.1 &.
2.1 &* oldname?  +  &n

Purpose

The SET SYNONYM subcommand has three formats.

Use Format 1 to specify whether the editor is to look for synonyms.

Use Format 2 to assign a synonym to any existing subcommand or macro (except prefix subcommands or prefix macros) and, optionally, to define an abbreviation for the synonym. (You must use the SET PREFIX subcommand to define a synonym for a prefix subcommand or macro.)

Use Format 3 to automatically rearrange operands in the order XEDIT expects. Do this when a synonym represents a subcommand whose operands are entered in a different order.

Operands

ON
specifies the editor is to look for synonyms.
OFF
specifies the editor is not to look for synonyms.
LINEND char
specifies a character that is interpreted as a line-end character regardless of the current SET LINEND setting at the time the synonym is used.
newname
is the synonym to be assigned to the subcommand or macro. The synonym can be an alphabetic string from 1 - 8 characters, or it can be a single alphabetic, numeric, or special character.
n
is the minimum number of characters you can enter for the synonym to be accepted, that is, its minimum abbreviation. If n is not specified, the full synonym name (newname) is required.
&
the operand is delimited by blanks.
&/
the operand is a string enclosed by delimiters, for example, /ABC/.
&.
the operand is the first of two strings separated by a common delimiter. The second string would be specified as &/.
&*
represents all the remaining data.
oldname
is the name of a subcommand or macro for which you are creating a synonym. It can be a compound name (for example, QUERY PF) or a subcommand name followed by its arguments.
&n
specifies the relative order which the new operands are to be inserted in the XEDIT subcommand, even though they are entered in a different order with the synonym. An &1 would represent the first operand in the synonym operand list, an &2 would represent the second operand, and so forth. The list specified here is positional and determines how the operands are to be rearranged.

Initial Setting

SYNONYM ON and the following synonyms are defined:
SET SYNONYM ALTER       2 ALTER
SET SYNONYM CAPPEND     2 CAPPEND
SET SYNONYM FILE        4 COMMAND PFILE
SET SYNONYM SSAVE       2 COMMAND SAVE
SET SYNONYM FFILE       2 COMMAND FILE
SET SYNONYM HELP        1 HELP
SET SYNONYM HEXTYPE     4 HEXTYPE
SET SYNONYM JOIN        1 JOIN
SET SYNONYM MODIFY      3 MODIFY
SET SYNONYM QUIT        4 COMMAND PQUIT
SET SYNONYM QQUIT       2 COMMAND QUIT
SET SYNONYM SAVE        4 COMMAND PSAVE
SET SYNONYM SPLIT       2 SPLIT
SET SYNONYM STATUS      4 STATUS

Usage Notes

  1. The newname operand can be the name of an existing XEDIT subcommand. In this case, the SYNONYM subcommand defines a new meaning for that subcommand name. The original meaning can be obtained by using:

    command oldname ...

    or

    set  synonym  off
    oldname...

  2. The newname can be alphabetic or it can be a single special character. For example:

    syn / 1 clocate/

    causes implicit LOCATEs, such as a /string/ target, to become CLOCATEs.

  3. Do not define a synonym for a name already defined as a synonym. For example:
    synonym erase delete
    synonym remove erase
    If you enter REMOVE, the editor looks for a subcommand called ERASE, not for a subcommand called DELETE.
    synonym add delete
    synonym linend $ SXMS locate/A/$ADD

    If you enter SXMS, a line is added after the line containing string A. The DELETE does not occur.

Examples

This section shows examples of the SET SYNONYM subcommand.

Example 1: In the following example, the Format 2 of SYNONYM is shown.

  1. syn down 1 up
  2. syn qpf query pf
  3. syn linend | QK 2 query pf|query pa|query enter

    Entering QK displays the PF, PA, and ENTER key settings.

Example 2: In the following example, the Format 3 of SYNONYM is shown.

  1. syn putfile 3 & & & & put &4 &1 &2 &3

    If you enter the command as follows:

    put fn ft fm n

    The editor rearranges it as follows:

    put n fn ft fm

  2. syn alter 2 &. &/ &* change /X'&1'/X'&2'/&3

    This example translates the subcommand:

    alter /7B/15/ * *

    to the following:

    change /X'7B'/X'15'/ * *

Messages and Return Codes

497E
Minimum abbreviation is between SO and SI [RC=5]
520E
Invalid operand: operand
544E
Invalid hex data: xxxxxxxx [RC=5]
545E
Missing operand(s) [RC=5]
547E
Synonym definition incomplete [RC=5]
548E
Invalid synonym operand: operand [RC=5]
549E
Synonym abbreviation too large [RC=5]
550E
Too many operands in synonym definition [RC=5]

where return codes are:

0
Normal
5
Invalid or missing operand(s)
6
Subcommand rejected in the profile due to LOAD error, or QUIT subcommand has been issued in a macro called from the last file in the ring