IMsTimeMatrix.CurrentIndex

Fore Syntax

CurrentIndex: Integer;

Fore.NET Syntax

CurrentIndex: integer;

Description

The CurrentIndex property returns the current calculation index.

Comments

To get series start index, use the IMsTimeMatrix.StartIndex property.

Fore Example

This example describes custom method.

To execute the example, add links to the Ms, Dimensions, MathFin system assemblies.

Public Function CalendarLevel(param: IMsTimeMatrix): Variant;
Var 
    Serie : ITimeSeries;
    index, i: integer;
    arr: Array Of Double;
Begin
    Serie := New TimeSeries.Create;
    index := param.CurrentIndex;
    If param.CalendarLevel = DimCalendarLevel.Year Then
        For i := 0 To param.PointCount - 1 Do
            arr := param.Column(i) As Array Of double;
            Serie.Item(index) := Math.Max(arr);
        End For;
    End If;
    Return Serie;
End Function CalendarLevel;

The method finds maximum values in matrix series points if matrix series contains annual calendar frequency.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.MathFin;

Public Function CalendarLevel(param: IMsTimeMatrix): object;
Var 
    Serie : ITimeSeries;
    index, i: integer;
    arr: Array Of Double;
    Math: MathClass = New MathClass();
Begin
    Serie := New TimeSeries.Create();
    index := param.CurrentIndex;
    If param.CalendarLevel = DimCalendarLevel.dclYear Then
        For i := 0 To param.PointCount - 1 Do
            arr := param.Column(i) As Array Of double;
            Serie.Item[index] := Math.Max(arr);
        End For;
    End If;
    Return Serie;
End Function CalendarLevel;

See also:

IMsTimeMatrix