Assert Method

           

Conditionally suspends execution at the line on which the method appears.

Syntax

object.Assert booleanexpression

The Assert method syntax has the following object qualifier and argument:

Part Description
object Required. Always the Debug object.
booleanexpression Required. An expression that evaluates to either True or False.

Remarks

Assert invocations work only within the development environment. When the module is compiled into an executable, the method calls on the Debug object are omitted.

All of booleanexpression is always evaluated. For example, even if the first part of an And expression evaluates False, the entire expression is evaluated.