IMsProblemCalculationCallback.OnBreak

Syntax

OnBreak(Breakpoint: IMsBreakpoint);

Parameters

Breakpoint. The breakpoint that generated the event.

Description

The OnBreak method implements the event that occurs on triggering the breakpoint during modeling problem calculation.

Comments

For correct use, the method must be redetermined in the user class that is the event handler. Also, this handler must be set in the parameters that are used for modeling problem calculation.

Example

The example displays the description of the user class that is the event handler. To execute the example, add a link to the Ms system assembly.

Class MCallback: ProblemCalculationCallback
    Public Sub OnError(Message: String);
    Begin
    End Sub OnError;
    
    Public Sub OnFinish;
    Begin
    End Sub OnFinish;
    
    Public Sub OnMessage(Message: String);
    Begin
        Debug.WriteLine(DateTime.Now.ToString + " > " + Message);
    End Sub OnMessage;
    
    Public Sub OnModelCalculation(Model: IMsModel);
    Begin
    End Sub OnModelCalculation;
    
    Public Sub OnStep;
    Begin
    End Sub OnStep;
    
    Public Sub OnBreak(Breakp: IMsBreakpoint);
    Var
        CalendBreak: IMsModelCalendarBreakpoint;
        DataBreak: IMsDataBreakpoint;
    Begin
        Debug.WriteLine("Breakpoint triggered!");
        Debug.WriteLine("    Point key: '" + Breakp.Key.ToString + "'");
        Debug.WriteLine("    Point name: '" + Breakp.Name + "'");
        Select Case Breakp.Kind
            Case MsBreakpointKind.ModelCalendar:
                Debug.WriteLine("    Calendar point");
                CalendBreak := Breakp As IMsModelCalendarBreakpoint;
                If CalendBreak.IsCalendarPointFixed Then
                    Debug.WriteLine("    Trigger date: " + CalendBreak.CalendarPoint.ToString);
                Else
                    Debug.WriteLine("    The point triggered for every calculation date");
                End If;
            Case MsBreakpointKind.Data:
                Debug.WriteLine("    The point for the data value");
                DataBreak := Breakp As IMsDataBreakpoint;
                Debug.WriteLine("    Triggering condition: " + DataBreak.Condition.AsString);
        End Select;
    End Sub OnBreak;
End Class MCallback;

The given class use for the event handling is given in description of IMsModelCalendarBreakpoint.CalendarPoint.

See also:

IMsProblemCalculationCallback