Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
ERROR Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
ERROR expression%
Usage Notes
■ If expression% is an error code already used by Visual Basic, the ERROR
statement simulates the occurrence of that error.
■ To define your own error code, use a value that is greater than any
used by the standard Basic error codes. Start by using error code
32,767 and work down to avoid compromising compatibility with future
Microsoft Basic error codes. In general, the error codes used by Visual
Basic are between 1 and 100, although not all these are used.
■ If an ERROR statement is executed when no error-handling routine
is enabled, Visual Basic generates an error message and stops program
execution. If the ERROR statement specified an error code that Visual
Basic does not use, the message "Unprintable error" is generated.