McBasic™Get McBasic™ ↗
Build 881
Runtime API

Errors and assertions

Use structured errors to preserve cleanup, and assertions to record behavior that must remain true.

Read the task-based guide before using an isolated signature. Arguments are positional unless a signature explicitly marks an optional argument.

McException#

Inspect a caught exception. Use Throw to rethrow without turning the failure into success.

BASIC-facing contract
Number As Long
Message As String
Source As String

Err#

The classic error object is separate from a caught McException. Do not mix error-handling styles without understanding their control flow.

BASIC-facing contract
Number, HelpContext As Long
Description, Source, HelpFile As String
Sub Clear()
Sub Raise(number As Long, Optional source As String, Optional description As String, Optional helpFile As String, Optional helpContext As Long)

Assert#

AreEqual requires compatible scalar types. Register test modules and run Test; Check does not execute assertions.

BASIC-facing contract
Sub AreEqual(expected, actual)
Sub IsTrue(condition As Boolean)
Sub IsFalse(condition As Boolean)
Sub IsNull(value As Variant)
Sub Fail(message As String)
Source baseline 20f4bfed6b · Build manifest