Hello,
starting from VB 3.0 until today i have a debugger which runs automatically and not stops every time at the first line (i hate this behaviour).
The MS debugger stops if any error happens exact at the line within the code.
I expect the same from the OEA debugger but the reality is something else.
This is my code:
routine-level
on error undo, throw.
do
:
def var a as int.
a = 1.
a = int("a").
a = 2.
end
.
I run this simple code with the debugger and enabled breakpoint "on any unsuppressed error"
1.) Stop at do (there is no breakpoint)
2.) Message box error 76 , helps shows a line numer which does not really helps, perssing Debug don't starts anything
3.) Application is terminated
I expect that the debugger breaks but nothing happens!
Little change:
routine-level
on error undo, throw.
do
on error undo, leave
on endkey undo, leave
on stop undo, retry
on quit undo, leave:
def var a as int.
a = 1.
a = int("a").
a = 2.
end
1.) the same
2.) the same
3.) Now debugger message box that it's stopped due Break on error 76
4.) Line pointer isn't at a = int("a) as i would expect, it't at the END statement.
I would expect that the debugger breaks at the line where the error happens.
In this example i know the line and error but not within a large application where i hope to break at the moment where the error happens and not
light-years later.
Does nobody hits the same problem?
Stefan
Hello Stefan,
The behavior of the breakpoint with "on any unsuppressed error" can be confusing, however, it is expected.
Let me try to explain it.
The Debugger in OpenEdge Architect, in the same way as the Procedure Editor and the AppBuilder, stops at the first executable line. At this time the breakpoints are synchronized. Then the Resume button can be used to continue the execution of the program.
The reason why the breakpoint "on any unsuppressed error" does not seem to take effect is because in the the error condition is not trapped (for example using on error undo, leave) and the program actually has finished executing.
On the second example, the error condition is trapped but the point where the Debugger gets control in the example is at the end of the block.
The stacktrace shown as in the message box has the line number from where the message was displayed.
I hope this explains the behavior and help you debug your programs.
Thanks,
Edsel