IMetabase.Item

Fore Syntax

Item(Key: Integer): IMetabaseObjectDescriptor;

Fore.NET Syntax

Item[Key: Integer]: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;

Parameters

Key. Repository object key.

Description

The Item property returns repository object description with the specified key.

Comments

The property returns Null, if object with the specified key is absent in repository.

Fore Example

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    MDesc := MB.Item(100);
    If MDesc <> Null Then
        Debug.WriteLine(MDesc.Id);
    Else
        Debug.WriteLine("Object with the 100 key is absent in repository.");
    End If;
End Sub UserProc;

After executing the example if an object with the "100" key exists in the repository, its identifier is displayed in a development environment console.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := Params.Metabase;
    MDesc := MB.Item[100];
    If MDesc <> Null Then
        System.Diagnostics.Debug.WriteLine(MDesc.Id);
    Else
        System.Diagnostics.Debug.WriteLine("Object with the 100 key is absent in repository.");
    End If;
End Sub;

See also:

IMetabase