ICalendarDimInstance.Week

Syntax

Week(El: Integer): Integer;

Parameters

El — element index.

Description

The Week method returns week index for the calendar dictionary element index of which is passed by the El parameter. This method returns -1 if the dictionary does not have the Weeks level.

Example

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.Week(Dim.Elements.FindById("WEEKS:7.1.2008"));

End Sub Main;

After executing the example the "i" variable contains index of appropriate calendar dictionary element. Dictionary identifier: CALENDAR_DIM.

See also:

ICalendarDimInstance