AddArray(ArrayValue: Array): ITimeSeries;
AddArray(ArrayValue: System.Array): Prognoz.Platform.Interop.Ms.TimeSeries;
ArrayValue. Values of array elements.
The AddArray method adds an array 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: IMsTimeMatrix): Variant;
Var
m : IMsTimeMatrix;
arr: Array[3] Of Double;
i, j: Integer;
s : String;
serie : ITimeSeries;
Begin
m := New MsTimeMatrix.Create;
arr[0] := 0.10;
arr[1] := 0.20;
arr[2] := 0.30;
m.AddArray(arr);
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;
Return m;
End Function Create;
The method adds an array to matrix. After that the console window displays resulting matrix series.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
…
Public Function Create(param: IMsTimeMatrix): object;
Var
m : IMsTimeMatrix;
arr: Array[3] Of Double;
i, j: Integer;
s : String;
serie : ITimeSeries;
Begin
m := New MsTimeMatrix.Create();
arr[0] := 0.10;
arr[1] := 0.20;
arr[2] := 0.30;
m.AddArray(arr);
System.Diagnostics.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;
System.Diagnostics.Debug.WriteLine("Series: " + i.ToString() + " - " + s);
End For;
Return m;
End Function Create;
See also: