LevelNumber: Integer;
LevelNumber: integer;
The LevelNumber property returns element level.
To get element name, use the IRdsDictionaryElement.Name property.
Executing the example requires MDM dictionary with the DIM identifier containing several elements.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Dict: IRdsDictionary;
Attrs: IRdsAttributes;
DictInst: IRdsDictionaryInstance;
Elements: IRdsDictionaryElements;
Element: IRdsDictionaryElement;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemById("DIM").Bind As IRdsDictionary;
Attrs := Dict.Attributes;
DictInst := Dict.Open(Null);
Elements := DictInst.Elements;
Element := Elements.Item(3);
Debug.WriteLine("Name = " + Element.Name +
"; Level = " + Element.LevelNumber.ToString);
End Sub UserProc;
After executing the example the console displays name and level of the third element of the MDM dictionary.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Rds;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Dict: IRdsDictionary;
Attrs: IRdsAttributes;
DictInst: IRdsDictionaryInstance;
Elements: IRdsDictionaryElements;
Element: IRdsDictionaryElement;
Begin
MB := Params.Metabase;
Dict := MB.ItemById["DIM"].Bind() As IRdsDictionary;
Attrs := Dict.Attributes;
DictInst := Dict.Open(Null);
Elements := DictInst.Elements;
Element := Elements.Item[3];
System.Diagnostics.Debug.WriteLine("Name = " + Element.Name +
"; Level = " + Element.LevelNumber.ToString());
End Sub;
See also: