IndexAttributesValues(Element: Integer): Variant;
Element — index of dictionary element.
The IndexAttributesValues method searches for the element with the number Element and returns value of all its attributes included into index.
Sub Main;
Var
MB: IMetabase;
Dimen: IDimInstance;
IndxsInst: IDimIndexesInstance;
IndexInst: IDimIndexInstance;
Attrs: IDimIndexAttributes;
v: Variant;
Attr: Array Of Variant;
i: Integer;
Begin
MB := MetabaseClass.Active;
Dimen := MB.ItemById("Dim_1").Open(Null) As IDimInstance;
IndxsInst := Dimen.Indexes;
If IndxsInst.Count <> 0 Then
IndexInst := IndxsInst.Item(0);
Attrs := IndexInst.Index.Attributes;
v := IndexInst.IndexAttributesValues(Dimen.Elements.Count - 1);
If v Is Array Then
Attr := v As Array;
For i := 0 To Attr.Length - 1 Do
Debug.Write("Attribute: " + Attrs.Item(i).Name);
Debug.WriteLine("; Element value by attribute: " + Attr[i]);
End For;
Else
Debug.Write("Attribute: " + Attrs.Item(i).Name);
Debug.WriteLine("; Element value by attribute: " + v);
End If;
End If;
End Sub Main;
After executing the example the development environment console shows names and values of the attributes which were used to create the first dictionary index, for the last dictionary element.
See also: