Unit 'utility' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

AddNamedObject

Add a named object to the given namespace.

Declaration

Source position: utility.pas line 263

function AddNamedObject(

  NameSpace: PNamedObject;

  Obj: PNamedObject

):LongBool;

Arguments

NameSpace

  

The NameSpace to add the NamedObject object to. If this value is nil, then the NamedObject will be added to the root NameSpace. This is useful for sharing NamedObjects between Tasks.

Function result

If the NamedObject can be added to either the supplied NameSpace or the system global NameSpace, this function will return True. Otherwise it will return False. This will generally happen when the NSF_NODUPS flag is set and this NamedObject has the same name as a second object, or when the object is already in a NameSpace.

Description

Adds a given NamedObject to a NameSpace which is addressed through a second NamedObject. Allows you to link a common group of NamedObjects together. If the NameSpace doesn't support duplicate names, then a search for a duplicate will be made, and False returned if one is found.

Errors

Although the AmigaOS 3.1 autodocs did not say so, under 3.0 you couldn't add a NamedObject to a NameSpace when the NamedObject you were adding had a NameSpace itself. This has changed. This is because the autodocs did not say this, and they are right :)

See also

RemNamedObject

  

Remove a named object.

AllocNamedObjectA

  

Allocate a named object.

AllocNamedObject

  

VarArgs Version for AllocNamedObjectA()

ReleaseNamedObject

  

Free a named object.

FreeNamedObject

  

Frees a name object.

AttemptRemNamedObject

  

Attempt to remove a named object.

FindNamedObject

  

Find the next object of a given name.

NamedObjectName

  

Return the name of the object.


Documentation generated on: 2021-07-30