AttributeValue(AttributeIndex: Integer): Variant;
AttributeIndex. Attribute index.
The AttributeValue property returns an attribute value by its index.
Use the IOrmRecord.FindAttribute method to get the index attribute by its identifier.
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.
See also: