NBS_FIND_ITEM

Find an item with a specified name contained in a structure associated with a specified identifier and return the located items ID

Description:

Check that the environment ID is not NIL and does not pertain to a primitive item.
Search for an item of the required name (dont assume that they are in any particular order).

The searching is performed using a binary search. This means that it takes roughly the same time to find all the items — best case performance is degraded but worst case performance is substantially improved.

Invocation

(Int) = NBS_FIND_ITEM (ENVID,NAME,ID,STATUS)

Arguments

ENVID = INTEGER (Given)
Identifier of the parent of the item which is to be found.
NAME = CHARACTER() (Given)
The name of the item to be found.
ID = INTEGER (Returned)
Identifier of the found item (zero if not found).
STATUS = INTEGER (Given and returned)
The global status. Possible return values are,
NBS__NILID NIL ID

NBS__PRIMITIVE Parent is primitive

NBS__ITEMNOTFOUND No item of this name exists