next up previous 372
Next: NBS_FIND_NTH_ITEM - Find the Nth item contained in a structure associated with a specified identifier and return the located item's
Up: Description of Individual NBS Routines
Previous: NBS_FIND_NOTICEBOARD - Find a named noticeboard and return an identifier to it


NBS_FIND_ITEM - Find an item with a specified name contained in a structure associated with a specified identifier and return the located item's 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 (don't 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



next up previous 372
Next: NBS_FIND_NTH_ITEM - Find the Nth item contained in a structure associated with a specified identifier and return the located item's
Up: Description of Individual NBS Routines
Previous: NBS_FIND_NOTICEBOARD - Find a named noticeboard and return an identifier to it

NBS The Noticeboard System
Starlink User Note 77
D.J. Allan
11 September 1995
E-mail:ussc@star.rl.ac.uk