Day(El: Integer): Integer;
El - index of the element that corresponds to a calendar period in the dictionary (Year, Half-Year, and so on).
The Day method returns index of an element indicating day in calendar dictionary. This day is the start date of calendar period, to which the El element corresponds.
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.Day(Dim.Elements.FindById("YEARS:2002"));
End Sub Main;
After executing the example the "i' variable contains index of the element corresponding to January 1, 2002. Dictionary identifier: CALENDAR_DIM.
See also: