IDimAttributes.Item

Fore Syntax

Item(Index: Variant): IDimAttribute;

Fore.NET Syntax

Item(Index: object): Prognoz.Platform.Interop.Dimensions.IDimAttribute;

Parameters

Index. Attribute index.

Description

The Item property returns an object containing dictionary attribute.

Comments

Attribute index is passed in the Index parameter.

Fore Example

Executing the example requires that the repository contains a table dictionary with the D_TO identifier.

Add links to the Dimensions, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    DimModel: IDimensionModel;
    Index: IDimIndex;
    IndAtr: IDimIndexAttributes;
    Atr: IDimAttribute;
    S: String;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    
// Get dictionary
    DimModel := MB.ItemById("D_TO").Bind As IDimensionModel;
    
// Get the first dictionary index
    Index := DimModel.Indexes.Item(0);
    
If Index <> Null Then
        
// Get attributes of the first dictionary index
        IndAtr := Index.Attributes;
        
// Get the first attribute
        Atr := IndAtr.Item(0);
        S := Atr.Name;
        Debug.WriteLine(
"Name of the first index attribute: " + S);
    
Elseif Index = Null Then
        Debug.WriteLine(
"Index is not found");
    
End If;
End Sub UserProc;

After executing the example the "S" variable contains name of the first attribute for the first dictionary index.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    DimModel: IDimensionModel;
    Index: IDimIndex;
    IndAtr: IDimIndexAttributes;
    Atr: IDimAttribute;
    S: String;
Begin
    // Get current repository
    MB := Params.Metabase;
    // Get dictionary
    DimModel := MB.ItemById["D_TO"].Bind() As IDimensionModel;
    // Get the first dictionary index
    Index := DimModel.Indexes.Item[0];
    If Index <> Null Then
        // Get attributes of the dictionary index
        IndAtr := Index.Attributes;
        // Get the first attribute
        Atr := IndAtr.Item[0];
        S := Atr.Name;
        System.Diagnostics.Debug.WriteLine("Name of the first index attribute: " + S);
    Elseif Index = Null Then
        System.Diagnostics.Debug.WriteLine("Index is not found");
    End If;
End Sub;

See also:

IDimAttributes