AddTerm(TermValue: IMsFormulaTerm): ITimeSeries;
TermValue. Term value.
The AddTerm method adds a term to matrix.
To add a series to matrix, use the IMsTimeMatrix.AddSerie method.
This example describes custom method.
To execute the example, add links to the Ms system assemblies.
Public Function Create(param: ITimeSeries): Variant;
Var
m : IMsTimeMatrix;
Term: IMsFormulaTerm;
i, j: Integer;
s : String;
serie : ITimeSeries;
Begin
m := New MsTimeMatrix.Create;
If param.CurrentDate < DateTime.Now Then
Debug.WriteLine("Series - " + m.Count.ToString);
Term := param.Item(i);
m.AddTerm(Term);
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);
Debug.WriteLine("Number of points between indexes of series start and end: "
+ m.CalcPointCount.ToString);
End For;
End If;
Return m;
End Function Create;
The method adds terms to matrix. After that the console window displays resulting matrix series and the number of points between indexes of series start and end.
See also: