ICalendarDimension.BlockInUse

Syntax

BlockInUse(LevelIndex: Integer; BlockIndex: Integer): Boolean;

Parameters

LevelIndex — level index.

BlockIndex — block index.

Table: Indexes of calendar dictionary block.

Block index Block name
0 Root.
1 Year.
2 Half-year.
3 Quarters.
4 Months.
5 Days.
6 Nine months.

Description

The BlockInUse property determines whether level block index of which is passed by the BlockIndex parameter is used on creating dictionary hierarchy, depending on the current dictionary hierarchy. This property is used if the 1st or 2nd type hierarchy is set for the dictionary. Hierarchy type is determined in the Hierarchy property.

Example

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

Sub UserProc;
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=6Or (j=7Then
            CalDim.BlockInUse(j,2):=True;
        End If;
    End For;
    MObj.Save;
End Sub UserProc;

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