• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1544
  • Last Modified:

delphi debug error ignore in runtime

I got some errors in Delphi that I catch with
try;except;
Once compiled, this runs fine however, when am I running it from Delphi in runtime mode (debug), I do not want my application to be stopped and I want to ignore these errors.
(Ignoring the try/except errors)
Any ideas ?
0
yarek
Asked:
yarek
  • 2
1 Solution
 
LimbeckCommented:
in your ide, goto your menu, and go to Tools,Options, Debugger options and see if you have 'notify on language exceptions'  there somewhere. it should be a check box. Uncheck that box and you will get the desired result.

After testing, turn it back on to catch your other errors ;)

good luck

Ed.
0
 
diniludCommented:
i am using D7

Tools > Debugger Options .
     Goto "Language exceptions" tab
     Remove tick from "Stop on Delphi Exceptions"
0
 
developmentguruCommented:
 As an alternative, try avoiding the exception. instead of...
try
  Result := A / B; // possible EDivideByZero
except
end;

do this...

  if C = 0 then
   Result := -1
else
  Result := A / B;

  Now I know that this is not always possible.  In area of code that could be called a few thousand times per second it can make  a big difference in speed since exception handling is costly.  Not only that, it will also get you around the problem of the application stopping while debugging.

The other problem that arises when you get into the habit of ignoring exception types is that you are then unaware of the same exception type happening in another area of your program where you want (or need) to see it.
0
 
developmentguruCommented:
oops if B = 0...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now