IMetaHierarchyPosition.LevelIndex

Syntax

LevelIndex: Integer;

Description

The LevelIndex property returns index of the level, to which position of hierarchy belongs.

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;

Position: IMetaHierarchyPosition;

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);

Position := HInstance.GetPathPosition("0");

Debug.WriteLine(Number of levels from a node: + Position.Offset.ToString);

Debug.WriteLine(Parent level: + Position.Parent.Level.Name);

Debug.WriteLine(Level: + Position.Level.Name);

Debug.WriteLine(Index of a level: + Position.LevelIndex.ToString);

End Sub Main;

After executing the example information about an element position of time series dictionary located at the path 0 is displayed in the console window.

See also:

IMetaHierarchyPosition