ICalendarDimInstance.Year

Syntax

Year(El: Integer): Integer;

Parameters

El — element index.

Description

The Year method returns year 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 Years level.

Example

Sub UserProc;
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(NullAs IDimInstance;
    CalClass:=New CalendarDimInstanceFactory.Create;
    CalInst:=CalClass.CreateCalendarDimInstance(Dim);
    i:=CalInst.Year(Dim.Elements.FindById("DAYS:12.12.2002"));
End Sub UserProc;

After executing the example the "i" variable contains index of calendar dictionary element corresponding to 2002 year. Dictionary identifier: CALENDAR_DIM.

See also:

ICalendarDimInstance