[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
DelphiAssert
assert

assert is a statement used for debugging. It is inherently implemented in Delphi (see the C++ assert that works the same for more details). The two pieces of code below show the use of assert. The first piece of code assumes something obviously false (i.e. that 2 equals 3), the second does the same without giving an error:

program Project1
{$APPTYPE CONSOLE}
{$ASSERTIONS ON}
uses
  sysUtils;
begin
  assert(2=3)
end.
The next program is in 'developmental stage':
program Project1
{$APPTYPE CONSOLE}
{$ASSERTIONS OFF}
uses
  sysUtils;
begin
  assert(2=3)
end.


last edited (July 20, 2005) by bilderbikkel, Number of views: 1181, Current Rev: 1

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.