IMsFormulaExecuteCallback.ResultMatrix

Syntax

ResultMatrix(Matrix: IMatrix; Conditions: IOrmConditions);

Parameters

Matrix. Data matrix.

Conditions. Conditions.

Description

The ResultMatrix method returns the resulting data matrix.

Example

Executing the example requires a form, the button Button1 that is placed on this form and the Memo component with the Memo1 identifier. The Memo1 component must contain model parameters as an XML code.

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:

IMsFormulaExecuteCallback