MPE/iX Intrinsics Reference Manual (32650-90875)

Chapter 10 599
Command Definitions (QUIT-ZSIZE)
SEARCH
The last entry in the array is a zero, specifying the end of the array as an entry of zero
length. The following model creates an array to expand abbreviated input (name) to its
appropriate command (definition).
5,1,"I","IN",
6,1,"O","OUT",
7,1,"S","SKIP",
7,1,"E","EXIT",
0;
In this model, the first entry specifies that the entry's length is five bytes. The name ("I") is
one byte and its definition is "IN". A 1 is returned in the
entrynum
signifying that the
matching name was the first entry in the array. (If no matching entry is found, a 0 is
returned.) The address of the definition, if specified, is returned in
definition
of the
SEARCH intrinsic call.
Because a search is linear, the most frequently used names should appear at the beginning
of the array to ensure efficient searching.
Related Information
Intrinsics MYCOMMAND