Error
 
Error handling statement to force an error to be generated

Syntax

Declare Sub Error ( errno As Integer )

Usage

Error errno

Parameters

errno
The error number to generate

Description

Generates a run-time error using the specified errno. This can be used to simulate custom error numbers.

No user error code range is defined, so if Error is used to set an user-defined error code it is wise to use high values, to avoid collisions in case the list of built-in errors list is enhanced.

See Runtime Error Codes for a listing of runtime error numbers and their associated meaning.

Example

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


Differences from QB

  • Error numbers are not the same as in QB.

See also