NineMonths(El: Integer): Integer;
El — element index.
The NineMonths method returns index of the element corresponding to nine-month period that contains element with the El index. The method returns -1 if the dictionary does no have the 9 Months level.
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.NineMonths(Dim.Elements.FindById("DAYS:12.12.2002"));
End Sub Main;
After executing the example the "i" variable contains index of calendar dictionary element corresponding to nine-month period, which includes the date 12.12.2002. Dictionary identifier: CALENDAR_DIM.
See also: