MPE/iX Intrinsics Reference Manual (32650-90875)
Chapter 9 509
Command Definitions (MAIL-PUTJCW)
MYCOMMAND
0:16 Always zero.
dictionary
character array (optional)
Passes the character array that is to be searched for the command name in
cmdimage
. The format must be identical to that of the
dictionary
parameter in the SEARCH intrinsic. The command, delimited by a blank, is
extracted from
cmdimage
, and the SEARCH intrinsic is called with the
command name used as the
buffer
parameter of SEARCH. If the command
name is found in
dictionary
, the functional return is its entry number. If
the command is not found, or if the
dictionary
parameter is not specified,
the functional return is zero. If
dictionary
is specified, but the command
name is not found in
dictionary
, the parameters specified in
cmdimage
are not formatted.
If this parameter is omitted, the functional return is 0.
definition
(NM) 32-bit address (optional)
(CM) 16-bit address (optional)
Returns a pointer to the byte following the command in
dictionary
. This
should be the
definition
, but may be invalid if
definition
is not used
for a command. Check the return status before the pointer is used.
Operation Notes
The MYCOMMAND intrinsic analyzes the command string, identifying the location and
characteristics of each parameter. If the dictionary is specified, the first parameter is
considered a command name. The array specified in
dictionary
is searched for the
command name. This dictionary is specially formatted as a SEARCH intrinsic array. (Refer
to the SEARCH intrinsic for the format of the array.) The entry number for the match is
returned in
entrynum
. If a definition exists for the matching entry, its address is returned
in
definition
.
All remaining entries in the command string are analyzed as parameters. (If
dictionary
is not entered, all input is considered parameter data.) A parameter consists of all
characters from the current pointer position to the next delimiter. A pointer to first
character is determined. Valid delimiters are defined in
delimiters
or by the default
delimiter ",=;(carriage return)". The delimiter type is identified by its position in the
defined delimiter list, for example, a comma is identified as 1, and a semicolon as 3. The
contents of the parameter are identified as special characters, numeric, or alphanumeric
characters.
Results of the analysis are returned in the array
params
. Two words of information are
specified for each parameter. The location pointer is entered in word 1, and the delimiter
and character information are entered in word 2 for each parameter. A maximum of
maxparms
parameters are analyzed. The actual number of parameters found are returned
to
numparms
. The
params
array can then be referred to in subsequent commands to access
the parameter data.
If the number of characters in
cmdimage
exceeds 255 characters and no delimiter is
present, the calling process is aborted and the following error message is printed: