MicroSoft QBasic Error/Message Codes
Collected by Valerio Capello aka Elf Qrin - http://www.ElfQrin.com

  1     Next without For
  2     Syntax error
  3     Return without Gosub
  4     Out of data
  5     Illegal function call
  6     Overflow
  7     Out of memory
  8     Label not defined
  9     Subscript ouf of range
 10     Duplicate definition
 11     Division by zero
 12     Illegal in direct mode
 13     Type mismatch
 14     Out of string space
 15     Unprintable error ***
 16     String formula too complex
 17     Cannot continue
 18     Function not defined
 19     No Resume
 20     Resume without error
 21-23  Unprintable error ***
 24     Device timeout
 25     Device fault
 26     For without Next
 27     Out of paper
 28     Unprintable error ***
 29     While without Wend
 30     Wend without While
 31-32  Unprintable error ***
 33     Duplicate label
 34     Unprintable error ***
 35     Subprogram not defined
 36     Unprintable error ***
 37     Argoment-count mismatch
 38     Array not defined
 39     Case Else expected
 40     Variable required
 41-49  Unprintable error ***
 50     Field overflow
 51     Internal error
 52     Bad file name or number
 53     File not found
 54     Bad file mode
 55     File already open
 56     Field statement active
 57     Device I/O error
 58     File already exists
 59     Bad record lenght
 60     Unprintable error ***
 61     Disk full
 62     Input past end of file
 63     Bad record number
 64     Bad file name
 65-66  Unprintable error ***
 67     Too many files
 68     Device unavaiable
 69     Communication-buffer overflow
 70     Permission denied
 71     Disk not ready
 72     Disk-media error
 73     Advanced feature unavailable
 74     Rename across disk
 75     Path/File access error
 76     Path not found
 77-255 Unprintable error ***

Error/Messages Total: 55
Unprintable errors Total: 21+179 = 200

HELP:

*  1     Next without For
Each NEXT statement must have a matching FOR statement.

Also verify that other control structures within the
FOR...NEXT structure are correctly matched. For example,
an IF without a matching ENDIF inside the FOR...NEXT
structure generates this error.

*  2     Syntax error
Several conditions can cause this error:
   At compile time, the most common cause is a mistyped
    QuickBASIC keyword or argument.
   At run time, the most common cause is an improperly
    formatted DATA statement.

*  3     Return without Gosub
The program just executed a RETURN statement without
executing a GOSUB.

*  4     Out of data
A READ statement has been executed but there are no DATA
statements with unread data remaining in the program.

*  5     Illegal function call
A parameter that is out of range has been passed to a
BASIC statement or function. For example, a screen row
number that is off the screen has been passed to the
LOCATE statement. Other examples of function call errors
are:
   An unreasonably large subscript is used
   A negative number is raised to a power that is not
    an integer
   A negative record number is given GET or PUT file I/O
    statements
   An I/O function or statement (LOC or LOF, for example)
    is performed on a device that does not support it.
   Strings are concatenated to create a string greater
    than 32,767 characters in length (variable-length
    strings only)
   A BLOAD or BSAVE operation is directed to a non-disk
    device
 
*  6     Overflow
The result of a calculation, or datatype conversion of
a procedure argument, was too large to be represented
within the range allowed for a number.

Use the Help menu's Contents command to look at the ranges
of numbers QuickBASIC can handle, as follows:
  1. Choose <OK> to close the error message dialog box.
  2. Press ALT+H to open the Help menu.
  3. Choose the Contents command.
  4. Choose the Limits to QuickBASIC hyperlink. The
     maximum numeric values that QuickBASIC can handle
     will be displayed in the Help window.
  5. Press ESC to clear the Help window.

*  7     Out of memory
More memory was required than is available. For example,
there may not be enough memory to allocate a file buffer.

In DOS
   Reduce the size of your DOS buffers
   Eliminate any terminate-and-stay resident programs
   Eliminate some device drivers
In QuickBASIC
   Try placing a $DYNAMIC metacommand at the top of your
    program if you have large arrays
   Unload any document or source files that are in memory
    but not needed
   Make your programs smaller
   Try to put your routines into a Quick library

*  8     Label not defined
The statement refers to a label that QuickBASIC cannot
find:
   GOTO, GOSUB, and single-line IF statements can only
    refer to labels in the current procedure.
   Labels that begin error-handling and event-handling
    routines must be in the main-module level of the
    program.

*  9     Subscript ouf of range
An array element was referenced with a subscript that was
outside the dimensions of the array, or an element of an
undimensioned dynamic array was accessed.

You may also get this error if the array size exceeds 64K,
the array is not dynamic, and the /AH option was not used.
Either
   Reduce the size of the array
   Make the array dynamic and re-invoke QuickBASIC using
    the /AH command-line option

* 10     Duplicate definition
You are using an identifier that has already been defined.

For example, you are attempting to use the same name
   in a CONST statement and a variable definition, or
   for a procedure and a variable.

This error also occurs if you attempt to redimension an
array. You must use DIM or REDIM when redimensioning dynamic
arrays.

* 11     Division by zero
Causes of this message are
   Dividing by zero in an expression
   Raising zero to a negative power

* 12     Illegal in direct mode
The highlighted statement is only valid within a program
and cannot be used in the Immediate window. In general
   The following nonexecutable statements cannot be used
    in the Immediate window:
    COMMON, CONST, DATA, DECLARE, DIM, OPTION, SHARED,
    STATIC, and TYPE
   The following metacommands cannot be used:
    $INCLUDE, $DYNAMIC, $STATIC
   The following other statements cannot be used:
    REDIM, SUB...END SUB, FUNCTION...END FUNCTION,
    DEF FN...END DEF, ELSE IF, END IF, END TYPE

* 13     Type mismatch
The highlighted variable, or the variable closest to the
highlighted keyword, is not of the required data type.

For example, you are trying to use the SWAP statement
with a string variable and a numeric variable, or with
two numeric variables of different types.

* 14     Out of string space
String variables exceeded the allocated amount of string
space. Try the following:
   Place a $DYNAMIC metacommand at the top of your
    program if you have large numeric arrays.
   Reduce the amount of memory used by the stack by
    executing a CLEAR statement.
   Unload any document or source files that are in memory
    but not needed.

* 15     Unprintable error ***
This error is caused by executing an ERROR command with
an ERR code value that is not recognized by QuickBASIC.
For example, executing the statement ERROR 66 will cause
this error.

* 16     String formula too complex
Either
   A string formula was too long, or
   An INPUT statement requested more than 15 string
    variables.

Break the formula or INPUT statement into smaller parts.

* 17     Cannot continue
While debugging, you have made a change that prevents
execution from continuing.

* 18     Function not defined
You must define a function before using it.

The module or Quick library that contains the function
definition may not be loaded.

* 19     No Resume
The end of the program was encountered while the program
was in an error-handling routine.

Add a RESUME statement in the error-handling routine.

* 20     Resume without error
A RESUME statement was encountered before an
error-trapping routine was entered.

* 21-23  Unprintable error ***
See error 15

* 24     Device timeout
The program did not receive information from an I/O device
within a predetermined amount of time.

* 25     Device fault
A device has returned a hardware error:
   If you are attempting to print a file, the printer
    is not attached to the parallel port LPT1.
   If data are being transmitted to a communications
    file, the signals being tested with the OPEN COM
    statement were not found in the specified period
    of time.

* 26     For without Next
Each FOR statement must have a matching NEXT statement.

* 27     Out of paper
The printer is out of paper, or it is not turned on.

* 28     Unprintable error ***
See error 15

* 29     While without Wend
Each WHILE statement must have a matching WEND statement.

* 30     Wend without While
Each WEND statement must have a matching WHILE statement.

Also verify that other control structures within the
WHILE...WEND structure are correctly matched. For
example, an IF without a matching ENDIF inside the
WHILE...WEND structure will generate this error.

* 31-32  Unprintable error ***
See error 15

* 33     Duplicate label
Two program lines were assigned the same number or label.
Each line number or label in a module must be unique.

Check all the SUB and function definitions in the module,
as well as the module-level code, for the duplicate label.
The Search menu's Find command is handy for this.

* 34     Unprintable error ***
See error 15

* 35     Subprogram not defined
You are attempting to call a SUB that QuickBASIC cannot
find in any loaded module or Quick library.

* 36     Unprintable error ***
See error 15

* 37     Argoment-count mismatch
An incorrect number of arguments was used in a
SUB or function call.

Compare the DECLARE statement for the SUB or function
with the CALL statement to make sure the argument list
has the same number of items in both cases. You can
use the Search menu's Find command to look at the DECLARE
statement.

* 38     Array not defined
Your program is attempting to use an array that is not
currently defined.

Make sure the array is defined with a DIM or REDIM
statement.

* 39     Case Else expected
No matching case was found for an expression in a SELECT
CASE statement.

* 40     Variable required
A GET or PUT statement must specify a variable when
operating on a file opened in binary mode.

* 41-49  Unprintable error ***
See error 15

* 50     Field overflow
A FIELD statement attempted to allocate more bytes than
were specified for the record length of a random-access
file.

* 51     Internal error
An internal malfunction occurred in QuickBASIC.

Use the Product Assistance Request form at the back of
Learning and Using Microsoft QuickBASIC to report the
conditions under which the message appeared.

(Do not report this if you generated the error message
by executing a BASIC ERROR 51 statement.)

* 52     Bad file name or number
Be sure file names and numbers are as follows:
   Valid file numbers are integers between 1 and 255.
   Valid file numbers refer to files that are currently
    open
   Valid file names use DOS file naming rules. For
    example, the file name extension must be three or
    less characters.

* 53     File not found
A FILES, KILL, NAME, OPEN or RUN statement referenced a
file that does not exist.

* 54     Bad file mode
This error occurs when the program is trying to
   Use PUT or GET statements with a sequential file
   Use a FIELD statement with a file not opened for
    random access
   Write to a file opened for input
   Read from a file opened for output or appending.

* 55     File already open
This message appears if you attempted to use
   An OPEN statement for a sequential file that
    was already open
   A KILL statement referring to an open file

* 56     Field statement active
A GET or PUT statement specified a record variable on a
file for which FIELD statements had been executed.

GET or PUT with a record-variable argument may only be
used on files where no FIELD statements have been
executed.

* 57     Device I/O error
An I/O error occurred on a device I/O operation.

The operating system cannot recover from the error.

* 58     File already exists
The file name specified in a NAME statement was identical
to a file name already on the disk.

* 59     Bad record lenght
A GET or PUT statement was executed to specify a record
variable whose length did not match the record length
specified in the corresponding OPEN statement.

* 60     Unprintable error ***
See error 15

* 61     Disk full
There wasn't enough room on the disk to complete a
PRINT #, WRITE #, or CLOSE operation.

This error can also occur if there is not enough room for
QuickBASIC to write out an object or executable file.

* 62     Input past end of file
An INPUT statement read from a null (empty) file or from
a file in which all data have already been read.

Use the EOF function to detect the end of file.

* 63     Bad record number
The record number in a PUT or GET statement was less than
or equal to zero.

* 64     Bad file name
An illegal form was used for the file name with LOAD,
SAVE, KILL, or OPEN (for example, the file name had
too many characters).

* 65-66  Unprintable error ***
See error 15

* 67     Too many files
At compile time, this error occurs when include files are
nested more than five levels deep.

At run time, QuickBASIC limits the number of disk files
that can be open at any one time, and your program
has exceeded that limit. Either increase the FILES=
parameter in the CONFIG.SYS file, or simplify your
program.

DOS has a limit to the number of entries in a root
directory. If your program is opening and closing files
in a root directory, change your program so it uses a
subdirectory.

* 68     Device unavaiable
The device you attempted to access is not on line or
does not exist.

* 69     Communication-buffer overflow
During remote communications, the receive buffer
overflowed.

The size of the receive buffer is set by the /C
command-line option or the RB option in the OPEN COM
statement. So,
   Check the buffer more frequently (with the LOC
    function)
   Empty the buffer more often (with the INPUT$
    function).

* 70     Permission denied:
An attempt was made to write to a write-protected disk,
a read-only file, or to access a locked file.

* 71     Disk not ready
The disk-drive door is open, or no disk is in the drive.

* 72     Disk-media error
Disk-drive hardware has detected a physical flaw on the
disk.

* 73     Advanced feature unavailable
You are attempting to use a QuickBASIC feature that is
is available with another version of BASIC or supported
only under a later version of DOS or OS/2.

* 74     Rename across disk
An attempt was made to rename a file with a new drive
designation. This is not allowed.

You can rename a file with a new drive designation by
loading the file and then saving it to the new drive
with a new file name. Then erase the original copy
of the file.

* 75     Path/File access error
During execution of an OPEN, MKDIR, CHDIR, or RMDIR
statement, the operating system was unable to make a
correct connection between the path name and the
file name.

The operation is not completed.

* 76     Path not found
During an OPEN, MKDIR, CHDIR, or RMDIR operation, DOS was
unable to find the path specified.

The operation is not completed.

* 77-255 Unprintable error ***
See error 15
