IMsDataBreakpoint.Condition

Syntax

Condition: IExpression;

Description

The Condition property determines whether breakpoint is triggered.

Comments

The operation condition of breakpoint is set by the expression that must return the result of logical type. The data point in the expression is determined by the Value keyword. Expression example: Value > 0. If this condition is set, the breakpoint is triggered in the data points, which value is greater than zero.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. This container should contain a modeling problem with the PROBLEM identifier that calculates a model containing a variable with the VARABLE identifier.

The example uses the MCallback class described in IMsProblemCalculationCallback.OnBreak.

Add links to the Cube, Dimensions, Matrix, Metabase, Ms system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    ModelSpaceDescr: IMetabaseObjectDescriptor;
    Problem: IMsProblem;
    CalcSettings: IMsProblemCalculationSettings;
    CallBack: MCallback;
    Calculation: IMsProblemCalculation;
    Breakpoints: IMsBreakpoints;
    Breakpoint: IMsBreakpoint;
    DataBreakpoint: IMsDataBreakpoint;
    Stub: IVariableStub;
    MatrixDs: IMatrixDataSource;
    SelSetSource, SelSetDest:IDimSelectionSet;
    i: Integer;
Begin
    Mb := MetabaseClass.Active;
    ModelSpaceDescr := Mb.ItemById("MODEL_SPACE");
    Problem := Mb.ItemByIdNamespace("PROBLEM",ModelSpaceDescr.Key).Edit As IMsProblem;
    CalcSettings := Problem.CreateCalculationSettings;
    CallBack := New MCallback.Create;
    CalcSettings.Callback := CallBack;
    CalcSettings.FactIncluded := True;
    Calculation := Problem.Calculate(CalcSettings);
    Breakpoints := Calculation.Breakpoints;
    Breakpoints.Clear;
    Breakpoint := Breakpoints.Add(MsBreakpointKind.Data);
    DataBreakpoint := Breakpoint As IMsDataBreakpoint;
    DataBreakpoint.Name := "DataBreakpoint";
    Stub := Mb.ItemByIdNamespace("VARABLE",ModelSpaceDescr.Key).Edit As IVariableStub;
    DataBreakpoint.Variable:= Stub;
    MatrixDs := Calculation.VariableStub(Stub);
    SelSetSource := MatrixDs.Execute(Null).Dimensions;
    SelSetDest := SelSetSource.CreateCopy;
    For i := 0 To SelSetDest.Count - 1 Do
    SelSetDest.Item(i).SelectAll;
    End For;
    DataBreakpoint.Selection := SelSetDest;
    DataBreakpoint.Condition.AsString := "Value = Null";
    Calculation.Run;
End Sub;

After executing the example the breakpoint is set for calculation problem. The breakpoint is triggered if the value in the calculated point for the VARABLE variable is set to Null.

See also:

IMsDataBreakpoint