IMetabase.GetObjectKeyById

Syntax

GetObjectKeyById(Value: String): Integer;

Parameters

Value is an object identifier.

Description

The GetObjectKeyById method returns a unique object key, which identifier is passed by the Value input parameter.

If an object with the specified key doesn't exist, the method returns the "-1" value.

Example

Sub Main;

Var

MB : IMetabase;

ObjKey: Integer;

Begin

MB := MetabaseClass.Active;

i := MB.GetObjectKeyById("TestObj");

If i <> -1 Then

MB.DeleteObject(i);

End If;

End Sub Main;

After executing the example if there is an object with the TestObj identifier in the repository, it is deleted.

See also:

IMetabase