Assertions in Basic+
For those of you who have done any Java or C/C++ programming in the past, assertions may be a familiar programming construct. For those who have not, an assertion is simply a way of embedding tests in your programs to check that a condition is true: if the condition evaluates to false then the program stops to display a message informing you of the failure, and presents a set of choices for dealing with it.
Assertions are basically “sanity checks” that you can employ anywhere in your programs to ensure that the state of your data is as you expect it. You should use normal error-handling code for errors you expect; you should use assertions for errors that should never occur.