IMsProblemCalculationSettings.BreakOnError

Syntax

BreakOnError: Boolean;

Description

The BreakOnError property determines whether modeling problem execution should be aborted when an error occurred.

Comments

Available values:

The property value is taken into account only on the step of problem calculation. If error occurred on data loading or initializing, the calculation is aborted regardless the value of BreakOnError.

Example

Executing the example requires a modeling problem with the 13380 key. Add links to the Metabase, Ms system assemblies. Also, the MCallback class, the description of which is given in IMsproblemCalculationCallback.OnWarning is used in the example.

Sub UserProc;
Var
    mb: IMetabase;
    Problem: IMsProblem;
    Calculation: IMsProblemCalculation;
    CallBack: MCallback;
    CalcSettings: IMsProblemCalculationSettings;
Begin
    mb := MetabaseClass.Active;
    Problem := mb.Item(13380).Bind As IMsProblem;
    CallBack := New MCallback.Create;
    CalcSettings := Problem.CreateCalculationSettings;
    CalcSettings.Callback := CallBack;
    CalcSettings.FactIncluded := True;
    CalcSettings.BreakOnError := True;
    Calculation := Problem.Calculate(CalcSettings);
    Calculation.Run;
End Sub UserProc;

After executing the example the problem is calculated. If there is an error, the calculation is stopped. The handler of the events occurring on problem calculation is the MCallback class.

See also:

IMsProblemCalculationSettings