Name(Element: Integer): String;
Element — index of dictionary element.
The Name property returns value of Name attribute for the element with the Element index.
The IDimAttributeInstance.DisplayValue property is used to get value of this property.
If alternative hierarchy is set for a dictionary, this property cannot be used to get element's name.
Executing the example requires that the repository contains a dictionary with the D_TO identifier.
Add links to the Metabase and Dimensions system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Dimen: IDimInstance;
Elem: IDimElements;
s: String;
i: Integer;
Begin
MB := MetabaseClass.Active;
Dimen := MB.ItemById("D_TO").Open(Null) As IDimInstance;
Elem := Dimen.Elements;
For i := 0 To Elem.Count - 1 Do
s := Elem.Name(i) + "; ";
Debug.WriteLine(s);
End For;
End Sub UserProc;
After executing the example the console window shows values of the Name attribute of the dictionary element.
See also: