ICalendarDimension.LevelInUse

Syntax

LevelInUse(LevelIndex: Integer): Boolean;

Parameters

LevelIndex — level index. Use the LevelIndex property to get level index.

Description

The LevelInUse property determines whether level, index of which is passed by the LevelIndex parameter, is used on creating the dictionary, depending on the current dictionary hierarchy.

Example

Executing the example assumes that the repository contains a calendar dictionary with the CALENDAR_DIM identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

CalDim: ICalendarDimension;

i, j: Integer;

Begin

MB:=MetabaseClass.Active;

MObj:=MB.ItemById("CALENDAR_DIM").Edit;

CalDim:=MObj As ICalendarDimension;

For i:=0 To CalDim.LevelCount-1 Do

j:=CalDim.LevelIndex(i);

CalDim.LevelInUse(j):=True;

If (j=6) Or (j=7) Then

CalDim.BlockInUse(j,2):=True;

End If;

End For;

MObj.Save;

End Sub Main;

After executing the example all levels are enabled in the calendar dictionary. If hierarchy of the 1st or 2nd type is set in the dictionary, the Half-years level is enabled.

See also:

ICalendarDimension | ICalendarDimension.LevelIndex