Hola,
Aunque no es exactamente lo que se pide, también podría ser de utilidad el procedimiento Assert, muy utilizada en C:
Código:
procedure Assert(expr : Boolean [; const msg: string]);
De la ayuda en línea (de Delphi):
"
In Delphi code, use Assert as a debugging tool to test that conditions assumed to be true are never violated. Assert provides an opportunity to intercept an unexpected condition and halt a program rather than allow execution to continue under unanticipated conditions.
Assert takes a Boolean expression and an optional message string as parameters. If the Boolean test fails, Assert raises an EAssertionFailed exception. If a message string was passed to Assert, the exception object is created with that string. Otherwise it is created with a default string indicating that the assertion failed. The message is displayed along with the complete path, filename, and the line number on which Assert failed."
Saludos