Node:Assert, Next:, Previous:asmname, Up:Reference



Assert

Synopsis


procedure Assert (Condition: Boolean);
or
procedure Assert (Condition: Boolean; const Message: String);

Description

Assert checks the given condition. If it is true, it does nothing. If it is false, it raises a runtime error, using the second argument for the message if given.

However, if the switch --no-assert is given (see GPC Command Line Options), Assert is deactivated. It still evaluates the condition if it has side effects, but never raises a runtime error.

Conforming to

Assert is a Borland Delphi extension.

Example

See also