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

### Assert

#### Synopsis

         procedure Assert (Condition: Boolean);

or

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

#### Description

`Assert` checks the given `Condition` at run-time. 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-assertions` 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

CompilerAssert.