bas7advr.hlp (Topic list)
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
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Simulates the occurrence of a BASIC error or a user-defined error.
 
ERROR integerexpression%
 
Usage Notes
    ■ If integerexpression% is an error code already used by 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
      255 and work down to avoid compromising compatibility with future
      Microsoft BASIC error codes.) In general, the error codes used by
      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, BASIC generates an error message and stops program
      execution. If the ERROR statement specified an error code that is
      not used by BASIC, the message "Unprintable error" is generated.