PeriodLength(El: Integer): Integer;
El — element index.
The PeriodLength method returns length of the period which includes the element passed by the El parameter. Period length is calculated in elements of the lower level of calendar dictionary.
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.PeriodLength(100);
End Sub Main;
After executing the example the "i" variable contains length of the period containing the 100th element of the calendar dictionary. Dictionary identifier: CALENDAR_DIM.
See also: