[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:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
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.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
