PrevPeriod(El: Integer): Integer;
El — index of element corresponding to the period.
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.
Sub Main;
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(Null) As IDimInstance;
CalClass:=New CalendarDimInstanceFactory.Create;
CalInst:=CalClass.CreateCalendarDimInstance(Dim);
i:=CalInst.PrevPeriod(25);
End Sub Main;
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: