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 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(200011);
        Per.IdentificationEndDate:= DateTime.ComposeDay(200411);
        Per.ForecastStartDate:= DateTime.ComposeDay(200511);
        Per.ForecastEndDate:= DateTime.ComposeDay(200711);
        Calcul.CurrentPoint:= DateTime.ComposeDay(200511);
        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