Equate

PURPOSE:  The EQUATE command allows you to enter commands by equating a Command Module (CM) or Process Module (PM) name defined with a name of your choice.  This new, equated command name can then be entered at the ACCENT R command level to invoke the specified CM or PM.  Equated commands allow for easy customization of ACCENT R for applications.  They particularly facilitate the use of ACCENT R for applications in languages other than English.

Syntax

EQUATE COMMAND command_name TO {CM; PM} object_name

[WITH {NO; OPTIONAL; REQUIRED; PRESERVED} /TEXT/]

command_name

is the name of the new equated command.  If the command name is a left subset of an existing, native ACCENT R command, it will replace the native command.  In this case, the new, equated command can be abbreviated like the native command it replaced.  Otherwise, the equated command must be entered in full and no abbreviation is accepted for it.

For example a new, equated command called DIR will replace the native DIRECTORY command, and this equated command can be invoked by entering DIR, DIRE, DIREC, etc.  However, a new command called DIRTY will not replace any native command, and it must be specified in full to be executed.

object_name

is the name of the CM or PM to be equated.  The existence of the CM or PM is not checked when the EQUATE command is given.

IN DBL dbl_name

is used to specify a CM or PM in another DBL.  If no DBL is declared when the EQUATE command is given, then the IN DBL clause must be included.

WITH NO TEXT

is the default and specifies that no text should follow the command keyword when the equated command is invoked.

WITH OPTIONAL TEXT

allows text to be included on the command line when the equated command is invoked.  The text of the command (including the command) can be generated with system function @COMMAND_TEXT and could be parsed and used by the CM or PM.

WITH REQUIRED TEXT

specifies that some text must follow the command keyword when the equated command is issued.  ACCENT R will generate an error message when no text follows the command keyword.  The text is available through system function @COMMAND_TEXT  and could be parsed and used by the Command Module or Process Module.

WITH PRESERVED TEXT

specifies that the string returned by @COMMAND_TEXT must not be changed by this equated command, and ACCENT R will issue an error message if text is entered after the equated command word.

EXAMPLES

In this example, the user alters his BEGIN.ACC file to include an EQUATE command.  Once the BEGIN.ACC file is saved, the user can execute the CM VANILLA during any future ACCENT R sessions simply by typing "VANILLA" at the command-level prompt.  The last three lines of the example come from the CM VANILLA.

*MODIFY SF BEGIN.ACC
--PRINT
00005  TYPE @VERSION
00010  DISABLE TERMINAL TAB
--15 EQUATE COMMAND READ1 TO CM READ1 IN DBL BOOKS
--SAVE
*QUIT
@ACCENT
*READ1
  $$$$$$$  BOOKS DISTRIBUTION.       $$$$$$$
  $$$$     DATA BASE UPDATE PROGRAM  $$$$
DO YOU WANT TO SEE THE MENU? ___

The next example shows an EQUATE command containing the REQUIRED TEXT option, requiring text to be entered along with the equated command keyword.  The equated CM shows the use of the @COMMAND_TEXT function and the parsing functions to use the entered text.  The equated command, SHOW, lists the named Schema Definition and extracts the records of the Data Set with the same name.

*EQUATE COMMAND SHOW TO CM SHOW WITH REQUIRED TEXT
*LIST CM SHOW
00100   SET @SUBSTR (@COMMAND_TEXT,6) TO @STRING
00110   LIST SD $@STRING
00120   TYPE ""
00130   USE DS $@STRING
00140   EXTRACT
*SHOW ROYALTIES_DBM2
00100   TITLE_CODE,CHAR,6
00120   LO_RANGE, INT, MAX
00130   HI_RANGE, INT, MAX
00140   ROYALTY,INT,3
CP2264  0 500 10
CP2264 501 700 12
CP2264 701 1000 15

NOTES:  There are two types of equated commands: system equated commands and local equated commands.  System equated commands are equated commands supplied by NIS or created by the system manager, which can be used by all users at the site.  System equated commands are automatically equated for all users at that site when they access ACCENT R.  System equated commands cannot be changed by a user, though they can be overridden or canceled by a user for a particular session.

Local equated commands are for that particular session.  Since a local equated command only stays in effect for the current session, it is suggested that user EQUATE commands be included in the local BEGIN.ACC file.

SEE ALSO:  CANCEL, COMMANDS, and NATIVE