Debug.Assert Method |
System.Diagnostics.Debug
Debug .Assert( booleanexpression [[, string1 ], string2 ])
Expression that evaluates to a Boolean value.
String to output if booleanexpression is False .
Detailed string to output. If booleanexpression is False , string2 is output to Output window.
None
Outputs messages to the Output window if the condition is False
booleanexpression must evaluate to a Boolean value.
Assert is typically used when debugging to test an expression that should evaluate to True .
Debug.Assert executes only when an application is run in the design-time environment; the statement has no effect in a compiled application. This means that Debug.Assert will never produce a runtime error if the call to it is inappropriate, nor will it suspend program execution outside of the VB IDE. Because of this, you do not have to remove Debug.Assert statements from finished code or separate them with conditional #If...Then statements.