IDynamicInstance.AttributeCount

Fore Syntax

AttributeCount: Integer;

Fore.NET Syntax

AttributeCount: integer;

Description

The AttributeCount property returns number of dictionary attributes.

Fore Example

Executing the example requires that the repository contains MDM table dictionary with set dynamic loading of elements and with the DYNDIM identifier.

Add links to the Dimensions and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Dim: IDynamicInstance;
    DimInst: IDimInstance;
    DimElementArr: IDimElementArray;
Begin
    MB := MetabaseClass.Active;
    Dim := MB.ItemById("DYNDIM").Open(NullAs IDynamicInstance;
    // Display dictionary name
    DimInst := Dim.DimInstance;
    Debug.WriteLine("Dictionary name: " + DimInst.Name);
    // Get array of all dictionary elements
    DimElementArr := Dim.CreateDimElementArray;
    // Display number of elements in dictionary
    Debug.WriteLine("Elements in dictionary: " + DimElementArr.Count.ToString);
    // Display number of dictionary attributes
    Debug.WriteLine("Number of attributes: " + Dim.AttributeCount.ToString);
End Sub UserProc;

After executing the example the console displays dictionary name, number of elements and number of attributes.

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;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Dim: IDynamicInstance;
    DimInst: IDimInstance;
    DimElementArr: IDimElementArray;
Begin
    MB := Params.Metabase;
    Dim := MB.ItemById["DYNDIM"].Open(NullAs IDynamicInstance;
    // Display dictionary name
    DimInst := Dim.DimInstance;
    System.Diagnostics.Debug.WriteLine("Dictionary name: " + DimInst.Name);
    // Get array of all dictionary elements
    DimElementArr := Dim.CreateDimElementArray();
    // Display number of elements in dictionary
    System.Diagnostics.Debug.WriteLine("Elements in dictionary: " + DimElementArr.Count);
    // Display number of dictionary attributes
    System.Diagnostics.Debug.WriteLine("Number of attributes: " + Dim.AttributeCount);
End Sub;

See also:

IDynamicInstance