IMetabase.GetObjectKeyByIdNamespace

Syntax

GetObjectKeyByIdNamespace(Value: String; [Namespace_: Integer = 0]): Integer;

GetObjectKeyByIdNamespace(Value: String; Namespace_: uinteger): uinteger;

Parameters

Value. Identifier of repository object.

Namespace. The key of the container object in which the repository object search will be performed. By default the 0 value is set, that is the search is performed by objects of the entire repository (objects from the root with 0 key).

Description

The GetObjectKeyByIdNamespace method returns the key of the object, located in the specified container by its identifier.

Comments

If the method is used via the Fore code, provided that the object with the specified identifier already does not exist, the method returns -1.

If the code is written in Fore.NET or using third-party development environments, and the object with the specified identifier does not exist, the method returns UInteger.MaxValue.

Example

Executing the example requires that the repository contains an object with the OBJ123 identifier and a container with the 63 key.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    ObjKey: Integer;
Begin
    MB := MetabaseClass.Active;
    ObjKey := MB.GetObjectKeyByIdNamespace(
"OBJ123"63);
    Debug.WriteLine(ObjKey);
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    ObjKey: uinteger;
Begin
    MB := Params.Metabase;
    ObjKey := MB.GetObjectKeyByIdNamespace(
"OBJ123"63);
    System.Diagnostics.Debug.WriteLine(ObjKey);
End Sub;

After executing the example the development environment console displays the object key with the OBJ123 identifier.

See also:

IMetabase | IMetabase.GetObjectKeyById