The following is an exhaustive list of the run-time errors which may be produced by a BASIC program compiled using the Basmark QuickBASIC Compiler. In parentheses, after each run-time error message, is the error code corresponding to the run-time error. In some cases, possible remedies to correct the error are suggested.
In any case, consider the wisdom: “When in doubt, print it out.” The most sophisticated debugging technique yet devised is the liberal application of print statements just prior to the offending statement to verify the contents of the computer against the contents of the programmer. Note that the computer usually does what it’s told to do vis-a-vis what it ought to do. Let Murphy’s Law inspire fear and loathing in your being. Aerobic exercise prolongs life, relieves stress and prevents damage to expensive electronic equipment.
Out of data(4): This error occurs when an attempt is made to read more items from data statements than exist.
Illegal function call(5): This error occurs when an attempt is made:
Overflow(6): This error occurs when the magnitude of the result of a calculation is too large to be stored in the target variable or when an attempt is made to read or input a numeric value which is too large to be stored in the target variable. It can also occur if an attempt is made to convert a floating point number outside the range from -32768 to 32767 to integer.
Out of memory(7): This error occurs when there is not enough free memory to be allocated for file buffers or strings.
Subscript out of range(9): This error occurs when an array subscript is outside the range of acceptable subscript values for the array as determined by dim and option base or by the default range of 0 to 10.
Division by zero(11): This error occurs when an attempt is made to divide by zero or raise zero to a negative power.
Type mismatch(13): This error occurs when an attempt is made to print a numeric value in a print using statement whose format string indicates that a string value is to be printed. The error also occurs when an attempt is made to print a string value in a print using statement whose format string indicates that a numeric value is to be printed.
No RESUME(19): This error occurs when the program terminates during the execution of an error handling routine.
RESUME without error(20): This error occurs when a resume statement is executed and error handling is not taking place.
FIELD overflow(50): This error occurs when the end of the field buffer is encountered while doing sequential output to a random file, or a field statement attempts to allocate more bytes than were specified for the record length of a random file in the open statement. Remedy: Make sure the open statement and the field statements agree. Check that the length of data sequentially read or written does not exceed the record length of the random file.
Internal error(51): This error occurs when something is amiss in your computer or in the operation of the compiler. This error also occurs if there is a failure in an attempt to execute a chain or run statement. It may also, however, reflect errors detected by the UNIX operating system which do not translate into the MS-DOS oriented error numbering scheme. Remedy: Please document the error and consult your hardware expert.
Bad file number(52): This error occurs as a result of using a file number that is less than one or greater than the maximum file number and as a result of using the file number of a file that is not open Remedy: Check for valid file specification, correct file number in the open statement, that the file you wanted was in fact opened.
File not found(53): This error occurs as a result of referencing a file that does not exist in a kill, name, files, or open statement. Remedy: Correct the file specification.
Bad file mode(54): This error occurs when an attempt is made to execute an open with a file mode other than input, output, append or random. This error will also occur if you try to use put or get with a sequential file. It also occurs if field or record locking is used on a sequential file or if eof is used on a sequential output file. It also occurs if an attempt is made to bload a file that was not saved by bsave. Remedy: Correct the file mode in the open statement. Get, put, field and record locking require a random file. Eof requires an input file.
File already open(55): This error occurs when an attempt is made to open a file using a file number already in use. Remedy: Use another file number.
File already exists(58): This error occurs when the filename specified in a name statement matches a filename that already exists in the specified directory. Remedy: Select some other filename.
Disk full(61): This error occurs when all available file system storage space is in use. Remedy: Free up file system space as necessary or report the problem to your system administrator.
Input past end(62): This is an end of file error and occurs when an attempt is made to read from a file that was open for output or append. The error also occur when trying to perform an input operation after all the data in a sequential file was already read, or when trying to input data from an empty file. Remedy: Use the eof function to detect the end of the file. First close and then open a sequential file that was being written before attempting to read from it.
Bad file name(64): This error occurs when using an invalid filename with kill, name, open, or files.
Disk Write Protect(70): This error occurs when an attempt is made to write to a file whose permissions do not include it for the current user or to violate a record lock held by another user. Remedy: Check the file permissions and modify as necessary. Interpret the record locking scheme used by your application. Be patient, communicate, be gentle but firm.
Disk not Ready(71): This error occurs when the device that is being addressed is either nonexistent or unavailable to the program. Remedy: Check “readiness” of the device (e.g., disk drive door closed, etc.) and/or correct program.
Disk Media Error(72): This error indicates the existence of a physical I/O problem detected as a hardware or medium fault. Remedy: Copy any existing files to a new medium and attempt to reformat the bad.
Unprintable error: An error has been detected by UNIX for which there is no corresponding BASIC error message. This is usually caused by an error statement with an undefined error code. Remedy: Check the program to insure that all programmed error codes are handled.
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber