DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Assertions are not working?

Does it seem that Assertions are not working? Do violate assertions not cause a 'break'?

If an assertion is violated within a try..except block, and you simply eat the exceptions, then you will not see the violation.
The reason is clear.. the assertion generates an EAssertionFailure exception which is eaten if you are running outside the IDE or in the IDE with

   assert(false, 'Always a Violation');
   on E:EMyException do ShowMessage('myCode() failed');
   else Raise; // this line is important!

Generated 12:01:35 on Aug 13, 2020