Name(Element: Integer): String;
Name[Element: uinteger]: 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.
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;
Dimen: IDimInstance;
Elem: IDimElements;
s: String;
i: UInt32;
Begin
MB := Params.Metabase;
Dimen := MB.ItemById["D_TO"].Open(Null) As IDimInstance;
Elem := Dimen.Elements;
For i := 0 To Elem.Count - 1 Do
s := Elem.Name[i];
System.Diagnostics.Debug.WriteLine(s + "; ");
End For;
End Sub;
See also: