Using Assert Messages
About Assert Messaging
──────────────────────────────────────────────────────────────────────────────

The Assert command also has an optional parameter, the Message clause. The
enables you to send a message to MrDebug's Assert/Trace window. By default
the ASSERT command send it's own message to the Assert/Trace window - which
may be a little lacking in it's detail.

Take a look at the following ASSERT command:

ASSERT oBrowse AS OBJECT
MESSAGE "This was not an object. It's Type is: ", VALTYPE(oBrowse)

Here you can see the optional MESSAGE clause of the ASSERT command. In the
case of the example above, this will send a message to the Assert/Trace
window if the variable oBrowse does not contain an object.

The above example is an excellent demonstration of when to use an
ASSERT...MESSAGE construct. In the example above, the program has halted
because of the Assertion. If the program were to continue, it would fall
over because the next line of code would be expecting an object. Obviously
something that expects an Object is not going to work with a variable that
contains a date.

However there are times when the use of an ASSERT...MESSAGE construct would
just get in the way - it does have the down side of halting execution of the
program.