[Overview][Constants][Types][Classes][Procedures and functions][Variables] |
Check validity of a given condition.
Source position: line 0
procedure Assert( |
Expr: Boolean |
); |
Expr: Boolean; |
const Msg: String |
); |
With assertions on, Asserttests if expris false, and if so, aborts the application with a Runtime error 227 and an optional error message in msg. If expris true, program execution continues normally. If assertions are not enabled at compile time, this routine does nothing, and no code is generated for the Assertcall. Enabling and disabling assertions at compile time is done via the \$Cor \$ASSERTIONScompiler switches. These are global switches. The default behavior of the assert call can be changed by setting a new handler in the AssertErrorProcvariable. Sysutils overrides the default handler to raise a EAssertionFailedexception.
None.
|
Stop program execution. |
|
|
Generate a run-time error. |