Condition: IExpression;
The Condition property returns whether breakpoint is triggered.
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.
Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. A modeling problem with the PROBLEM identifier that calculates the problem containing a variable with the VARABLE identifier must be present in this container. The example uses the MCallback class described in IMsproblemCalculationCallback.OnBreak.
Add links to the Cube, Dimensions, Matrix, Metabase, Ms system assemblies.
Sub Main;
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 Main;
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: