ICalendarDimInstance.PrevPeriod

Syntax

PrevPeriod(El: Integer): Integer;

Parameters

El — index of element corresponding to the period.

Description

The PrevtPeriod method returns index of the element corresponding to the previous period relative to the period containing the El element. The method returns -1 if there is no previous period.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Obj: IMetabaseObjectDescriptor;
    CalClass: CalendarDimInstanceFactory;
    Dim: IDimInstance;
    CalInst: ICalendarDimInstance;
    i: Integer;
Begin
    Mb:=MetabaseClass.Active;
    Obj:=Mb.ItemById("CALENDAR_DIM");
    Dim:=Obj.Open(NullAs IDimInstance;
    CalClass:=New CalendarDimInstanceFactory.Create;
    CalInst:=CalClass.CreateCalendarDimInstance(Dim);
    i:=CalInst.PrevPeriod(25);
End Sub UserProc;

After executing the example the "i" variable contains index of the element corresponding to the previous period relative to period corresponding to the 25th element. Dictionary identifier: CALENDAR_DIM.

See also:

ICalendarDimInstance