MPE/iX Intrinsics Reference Manual (32650-90875)

598 Chapter10
Command Definitions (QUIT-ZSIZE)
SEARCH
SEARCH
NM and CM callable (differences noted below).
Searches a specially-formatted array for a specified entry or name.
Syntax
I16 CA I16V CA
entrynum
:=SEARCH(
buffer,length,dictionary
,
@*
definition
);
Functional Return
entrynum
16-bit signed integer (assigned functional return)
Returns the entry number of the name in
dictionary
that matches
buffer
. If the name specified in
buffer
is not found, a zero is returned.
Parameters
buffer
character array (required)
Passes the name for which the search is to be performed.
length
16-bit signed integer by value (required)
Passes the length, in characters, of the array
buffer
.
dictionary
character array (required)
Passes the name of the specially formatted array that is to be searched for
buffer
.
definition
(NM) 32-bit address (optional)
(CM) 16-bit address (optional)
Returns the address of the command entry definition in
dictionary
.
Operation Notes
The SEARCH intrinsic requires a specially formatted array of sequential entries. Each entry
in the array is formatted in the following way:
byte 1 An integer that specifies the length (in bytes) of the entire entry. (The
length includes this byte.)
byte 2 An integer that specifies the length (in bytes) of the name.
bytes 3 + A string containing the name. (This name and the name length are
checked against the search string for a match.)
bytes x + An optional string containing a user-defined definition.