To start the Debugger and control breakpoints from an ABL procedure:

  1. Optionally, define a logical variable you can use to assign the return value for DEBUGGER system handle methods.
  2. Add a DEBUGGER system handle statement that invokes the INITIATE( ) method before the point where you want to begin debugging. This initializes the Debugger but does not immediately make it visible.
  3. Add one or more DEBUGGER system handle statements that invoke the SET-BREAK( ) method to set at least one breakpoint that occurs after the statement where you set it. The SET-BREAK( ) method that sets the breakpoint must also execute after the statement that invokes the INITIATE( ) method in the previous step.
  4. Run the invoking procedure.

For example, in the following listing fragment, the Debugger is initialized on line 3, and the procedure stops at a breakpoint on line 11. The Debugger takes control at this point. From here, you can continue executing the invoking procedure under Debugger control, stopping at and continuing from all breakpoints, as shown:

        1   DEFINE VARIABLE s-com AS CHARACTER NO-UNDO FORMAT "x(40)" EXTENT 5.
        2   DEFINE VARIABLE debug AS LOGICAL NO-UNDO.
        3   debug = DEBUGGER:INITIATE().
        4   FORM
        5     "Shipped   :" order.ship-date AT 13 SKIP
        6     "Misc Info :" order.instructions AT 13 SKIP(1)
        7     "Order Comments :" s-com AT 1
        8     WITH FRAME o-com CENTERED NO-LABELS TITLE "Shipping Information".
        9   FOR EACH Customer NO-LOCK, EACH Order OF Customer:
       10     debug = DEBUGGER:SET-BREAK().
 * =>  11     DISPLAY Customer.CustNum Customer.Name Order.OrderNum Order.OrderDate
       12       Order.PromiseDate WITH FRAME order-hdr CENTERED.
       13     UPDATE Order.ShipDate Order.Instructions TEXT(s-com) WITH FRAME o-com.
       14     s-com = "".
       15   END.
       16   . . .

When you exit the Debugger, the AVM instance continues execution from its current stopping (or breaking) point. If you exit the procedure before exiting the Debugger, the Debugger window closes and control returns to the startup environment (such as the Procedure Editor or AppBuilder).