IOrmRecord.AttributeValue

Fore Syntax

AttributeValue(AttributeIndex: Integer): Variant;

Fore.NET Syntax

AttributeValue[AttributeIndex: integer]: object;

Parameters

AttributeIndex. Attribute index.

Description

The AttributeValue property returns an attribute value by its index.

Comments

Use the IOrmRecord.FindAttribute method to get the index attribute by its identifier.

Fore Example

Executing the example requires a form containing the MetaAttributesBreadcrumb component and the MetaAttributesTreeList component with the MetaAttributesTreeList1 identifier. The components are set to work jointly with a time series database.

Add links to the Cubes, Metabase, Orm, Rds system assemblies.

Sub RecordProc;
Var
    Facts: IMetaDictionary;
    Atts: IMetaAttributes;
    SelNodes: Array;
    MembersSet: IMetaMembersSet;
    Member: IMetaMember;
    Rec: IOrmRecord;
    i, AtrIndex: Integer;
    Att: IMetaAttribute;
Begin
    // Get time series dictionary
    Facts := MetaAttributesTreeList1.Rubricator.Facts;
    // Get time series attributes
    Atts := Facts.Attributes;
    // Get elements selected in a series tree
    SelNodes := MetaAttributesTreeList1.GetSelectedNodes;
    MembersSet := MetaAttributesTreeList1.GetNodesMembers(SelNodes);
    MembersSet.Reset;
    // Display information about elements in the console window
    While Not MembersSet.Eof Do
        Member := MembersSet.Current;
        Debug.WriteLine("Element: " + Member.Name);
        Rec := Member.Tuple;
        Debug.WriteLine("Values of element attributes:");
        For i := 0 To Atts.Count - 1 Do
            Att := Atts.Item(i);
            AtrIndex := Rec.FindAttribute(Att.Id);
            If AtrIndex <> -1 Then
                Debug.Indent;
                Debug.Write(" attribute: '" + Att.Name + "'; value: ");
                Debug.Unindent;
                Debug.WriteLine(Rec.AttributeValue(AtrIndex));
            End If;
        End For;
        Debug.WriteLine("");
        MembersSet.Next;
    End While;
End Sub RecordProc;

After executing the example the console window shows information about the elements selected in the MetaAttributesTreeList1 component.

Fore.NET Example

Executing the example requires a .NET form containing the MetaAttributesBreadcrumbNet component and the MetaAttributesTreeListNet component with the metaAttributesTreeListNet1 identifier. The components are set to work jointly with a time series database.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.Rds;

Sub RecordProc();
Var
    Facts: IMetaDictionary;
    Atts: IMetaAttributes;
    SelNodes: Array;
    MembersSet: IMetaMembersSet;
    Member: IMetaMember;
    Rec: IOrmRecord;
    i, AtrIndex: Integer;
    Att: IMetaAttribute;
Begin
    // Get time series dictionary
    Facts := metaAttributesTreeListNet1.Rubricator.Facts;
    // Get time series attributes
    Atts := Facts.Attributes;
    // Get elements selected in a series tree
    SelNodes := metaAttributesTreeListNet1.CtrlBox.GetSelectedNodes();
    MembersSet := metaAttributesTreeListNet1.CtrlBox.GetNodesMembers(SelNodes);
    MembersSet.Reset();
    // Display information about elements in the console window
    While Not MembersSet.Eof() Do
        Member := MembersSet.Current();
        System.Diagnostics.Debug.WriteLine("Element: " + Member.Name);
        Rec := Member.Tuple;
        System.Diagnostics.Debug.WriteLine("Values of element attributes:");
        For i := 0 To Atts.Count - 1 Do
            Att := Atts.Item[i];
            AtrIndex := Rec.FindAttribute(Att.Id);
            If AtrIndex <> -1 Then
                System.Diagnostics.Debug.Indent();
                System.Diagnostics.Debug.Write(" attribute: '" + Att.Name + "'; value: ");
                System.Diagnostics.Debug.Unindent();
                System.Diagnostics.Debug.WriteLine(Rec.AttributeValue[AtrIndex]);
            End If;
        End For;
        System.Diagnostics.Debug.WriteLine("");
        MembersSet.Next();
    End While;
End Sub RecordProc;

After executing the example the console window displays information about the elements selected in the metaAttributesTreeListNet1 component.

See also:

IOrmRecord