Try OpenEdge Now
skip to main content
Debugging and Troubleshooting
OpenEdge Debugger : Debugger Window and Files : Debugger dialog boxes : New Breakpoint dialog box : Procedure names and line numbers
 
Procedure names and line numbers
Consider the following when setting a breakpoint:
*If you specify only a procedure name, the breakpoint is set on the first executable line of the procedure.
*If you do not specify a procedure name, the breakpoint is set on the specified line in the procedure currently displayed in the source code pane.
*If you specify a line number that is before any executable line in the code for the active procedure in the Debugger context, the breakpoint is set on the first executable line on or after the specified line. For example, if you specify line number 10 for an active procedure displayed with the following lines, the breakpoint is actually set on line 12:

10 /* Set Startup Temperature */
11 DEFINE VARIABLE InitialTemp AS INTEGER NO-UNDO.
12 ASSIGN InitialTemp = 32.
If there is no executable line on or after the specified line, the breakpoint is set on the last executable line. For example, if you specify line number 20 for the lines displayed above, the breakpoint is also set on line 12.
*If you specify a line number for an inactive procedure, the breakpoint is set on the specified line. When the procedure becomes active in the Debugger context, the specified breakpoint adjusts to the corresponding effective breakpoint line.
*When setting a breakpoint, there is a distinction between specifying a line number value less than 1 and specifying a value of 1 or more. Any value less than 1 (for example, 0 or –1) specifies the first executable line of the main procedure in the procedure file. Any positive value specifies the first executable line on or after the specified line in the procedure file. For example, suppose the procedure file starts out like this:

1 DEFINE VARIABLE lStart AS LOGICAL INITIAL TRUE.
2 PROCEDURE ShowStart:
3        IF lStart THEN MESSAGE "Procedure is starting ...".
4 END.
5
6 MESSAGE "Hello World!".
7 RUN ShowStart.
8 lStart = FALSE.
                      .
                      .
                      .
If you specify a breakpoint at line 0, –1, or any other negative value, the breakpoint actually occurs at line 6, the first line that executes in the main procedure. If you specify a breakpoint at line 1 or 2, the breakpoint occurs at line 3, the first executable line after 1 and 2, which happens to be the first executable line of an internal procedure.
This distinction also affects procedures containing the trigger phrase used to define triggers in object definitions. For example, suppose the procedure file starts out like this:

1 DEFINE BUTTON bOK LABEL "OK"
2        TRIGGERS:
3          ON CHOOSE
4            MESSAGE "OK Pressed!".
5        END TRIGGERS.
6 MESSAGE "Hello World!".
                     .
                     .
  .
Again, if you specify a breakpoint at line –1, the breakpoint occurs on line 6, but if you specify the breakpoint at line 1, it occurs at line 4, which is the first executable line of a trigger block.