[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'utility' (#aros)


Find the next object of a given name.


Source position: utility.pas line 244

function FindNamedObject(

  NameSpace: PNamedObject;

  const Name: STRPTR;

  LastObject: PNamedObject





The NameSpace to search through. If nil will use the system default NameSpace.



The name of the object to search for. If nil, any and all NamedObjects will be matched.



The (optional) last NamedObject to start the search from.

Function result

If a NamedObject with the name supplied exists, it will be returned. Otherwise will return nil. When you have finised with this NamedObject, you should call ReleaseNamedObject().


Finds an object and adds to the open count of the object. The object is guaranteed not to be freed until ReleaseNamedObject() is called. The name comparison is caseless, using the current locale string comparison routines.

If name is nil, then all objects will be matched.

If lastObject is non-nil, it must be an object from the same NameSpace found on a previous call to FindNamedObject(). It will not be freed by this call. The search will start at the node after lastobject, if non-nil.

nameSpace is the name space from the named object given or the root name space if nil is given.

If you are going to use a returned NamedObject to be the starting point for another search you must call ReleaseNamedObject()after searching, as the ReleaseNamedObject() call can cause the NamedObject to be freed, leaving you with an invalid pointer.

See also



Free a named object.

Documentation generated on: 2017-01-10