IMetaMembersTree.CurrentPosition

Syntax

CurrentPosition: IMetaHierarchyPosition;

Description

The CurrentPosition property returns a current position in elements hierarchy.

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.

Sub Main;

Var

Mb: Imetabase;

Rubr: IMetabaseObject;

RubrInst: IRubricatorInstance;

Facts: IMetaDictionaryInstance;

Hierarchy: IMetaHierarchy;

HInstance: IMetaHierarchyInstance;

Tree: IMetaMembersTree;

Begin

Mb := MetabaseClass.Active;

Rubr := MB.ItemById("OBJ_FC").Edit;

RubrInst := Rubr.Open(Null) As IRubricatorInstance;

Facts := RubrInst.GetDictionary(RubricatorDictionary.Facts);

Hierarchy := Facts.Dictionary.DefaultHierarchy;

HInstance := Facts.OpenHierarchy(Hierarchy);

Tree := HInstance.GetRootTree;

Tree.Reset;

While Not Tree.Eof Do

If Tree.CurrentPosition.LevelIndex = 0 Then

Debug.WriteLine(Tree.Current.Name);

End If;

Tree.Next;

End While;

End Sub Main;

After executing the example the names of all root elements of hierarchy first level are displayed in the console window.

See also:

IMetaMembersTree