IMsTimeMatrix.AddConstant

Syntax

AddConstant(ConstantValue: Variant): ITimeSeries;

Parameters

ConstantValue. Value of constant.

Description

The AddConstant method adds a constant to matrix.

Comments

To add a series to matrix, use the IMsTimeMatrix.AddSerie method.

Example

This example describes custom method.

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

Public Function CreateLevel(param: IMsTimeMatrix): Variant;
Var 
    m : IMsTimeMatrix;
    i, j: Integer;
    s : String;
    serie : ITimeSeries;
Begin
    m := New MsTimeMatrix.CreateLevel(DimCalendarLevel.Year);
    m.AddConstant(13);
    m.AddConstant(5);
    If param.StartDate = DateTime.ComposeDay(2014,7,8Then
        Debug.WriteLine("Series: " + m.Count.ToString);
        For i := 0 To m.Count - 1 Do
            s := "";
            serie := m.Item(i);
            For j := m.StartIndex To m.EndIndex Do
                s := s + (serie.Item(j) As double).ToString + " ";
            End For;
            Debug.WriteLine("Series: " + i.ToString + " - " + s);
        End For;
    End If;
    Return m;
End Function CreateLevel;

The method adds constants to matrix. After that the console window displays resulting matrix series.

See also:

IMsTimeMatrix