ASSERT
Assertion checking
──────────────────────────────────────────────────────────────────────────────

Syntax

ASSERT [<lExp>] [MESSAGE <list,...>]

Arguments

<lExp> is the expression to test. If this expression evaluates to FALSE,
then the assertion message is sent to MrDebug, and the program stops.

<list,...> is an optional list of message strings or expressions to use
as a message for the MrDebug Asset/Trace window. If <list,...> is
omitted, then <lExp> is used as the message for the Assert/Trace window.

Description

Assertions are most commonly used to test certain conditions that can't
be easily test with the parameter type checking. For example, you may
want to make sure that an ARRAY type parameter is of a specified length,
or that an object is of a specific class.

Example

This example checks that the array parameter is at least 5 elements
long.

#define MIN_ITEMS 5

FUNCTION Test(aList AS ARRAY)

ASSERT Len(aList) >= MIN_ITEMS
MESSAGE "We must have at least", MIN_ITEMS, "elements"

..
..

RETURN (NIL)

Files: Header file is MrDebug.CH