ResultMatrix(Matrix: IMatrix; Conditions: IOrmConditions);
Matrix. Data matrix.
Conditions. Conditions.
The ResultMatrix method returns the resulting data matrix.
Executing the example requires that the repository contains a form with the Button1 button and the Memo component named Memo1. The Memo1 component must contain model parameters as an XML code.
Add links to the Matrix, Metabase, Ms, and Orm system assemblies.
Class MsCallbackimpl:Object, IMsFormulaExecuteCallback
Sub ResultMatrix(Matrix: IMatrix; Conditions: IOrmConditions);
Var
Ite: IMatrixIterator;
Begin
Debug.WriteLine("Execution.");
Ite := Matrix.CreateIterator;
Ite.Move(IteratorDirection.First);
While Ite.Valid Do
Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.Next);
End While;
End Sub ResultMatrix;
End class MsCallbackimpl;
Class OBJ28600Form:Form
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ActiveMetabase: IMetabase;
Transform: IMsFormulaTransform;
TransformVar: IMsFormulaTransformVariable;
Coord: IMsFormulaTransformCoord;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Calcul: IMsMethodCalculation;
Per: IMsModelPeriod;
CallBack: MsCallbackimpl;
XmlNode: IXmlDomElement;
cl: FreeThreadedDOMDocument60;
Begin
ActiveMetabase := MetabaseClass.Active;
cl := New FreeThreadedDOMDocument60.Create;
cl.loadXML(Memo1.Text);
XmlNode := cl.documentElement;
Transform := New MsFormulaTransform.Create(ActiveMetabase);
Transform.LoadFromXml(XmlNode);
TransformVar := Transform.Outputs.Item(0);
Coord := Transform.CreateCoord(TransformVar);
Slice := TransformVar.Slices.Item(0);
Selector := Transform.CreateSelector;
Selector.Slice := Slice;
Formula := Transform.Transform(Selector);
Calcul := Transform.CreateCalculation;
Per := Calcul.Period;
Per.IdentificationStartDate:= DateTime.ComposeDay(2000, 1, 1);
Per.IdentificationEndDate:= DateTime.ComposeDay(2004, 1, 1);
Per.ForecastStartDate:= DateTime.ComposeDay(2005, 1, 1);
Per.ForecastEndDate:= DateTime.ComposeDay(2007, 1, 1);
Calcul.CurrentPoint:= DateTime.ComposeDay(2005, 1, 1);
CallBack := New MsCallbackimpl.Create;
Formula.Execute(Calcul,Coord, CallBack);
End Sub Button1OnClick;
End Class OBJ28600Form;
After executing the example the model parameters are loaded to the TRANSFORM variable. The modal method is calculated.
See also: