Skip to content
Paul Squires edited this page Oct 19, 2026 · 3 revisions

Home › Error Handling Functions › Error

Error

Raises a runtime error by number: jumps to the handler, or ends the program.

Syntax

Declare Sub Error ( errno As Long )

Parameters

  • number

Description

Error invokes the error handler specified with On Error or, in case there was none set, aborts the program, printing an error message similar to those generated by the compiler's -exx run-time error checking. It's possible to use the built-in run-time error numbers and/or other custom error numbers for number. This can be used to simulate custom error numbers.

Remarks

Usage

Error number

Differences from QB

  • Error numbers are not the same as in QB.

See also

Examples

To send an error alert of error 150 (just some arbitrary error code) one would do the following:

Error 150


Category: Error Handling Functions
Kind: sub


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally