ERROR Codes

From QB64 Wiki

Jump to: navigation, search

The following table describes the error codes that are thrown by the QB64 runtime, as well as possible causes and solutions:

NOTE: QB64 does not currently return these errors.
QB error codes
Code Description Common cause/resolution QB64 differences
1 NEXT without FOR Usually an END block statement was omitted from an IF or SELECT CASE. none
2 Syntax error Mistyped keyword statement syntax errors. none
3 RETURN without GOSUB A RETURN statement not in a GOSUB. none
4 Out of DATA A READ has read past the end of DATA. Use RESTORE first. none
5 Illegal function call A parameter passed does not match the function type or exceeds certain function limitations. Illegal Function none
6 Overflow A numerical value has exceeded the type limitations. none
7 Out of memory A module has exceeded the 64K memory limitation of QB. Try breaking the code up to smaller modules. QB64 does not have that limitation.
8 Label not defined GOTO or GOSUB tries to branch to a label that doesn't exist. none
9 Subscript out of range An array's upper or lower bounds have been exceeded. none
10 Duplicate definition You can't define a variable twice with DIM, the first time a variable is used it is also defined. none
11 Division by zero You cannot divide any value by zero! Even using MOD. none
12 Illegal in direct mode A statement (like DIM) in the Immediate window wasn't allowed. QB64 has no direct mode.
13 Type mismatch A SUB or Function parameter does not match the procedure Declaration. none
14 Out of string space A module has exceeded the 32767 text character limit. Use SUB print procedures. QB64 doesn't have that limitation.
16 String formula too complex. A string formula was too long or a INPUT statement requested more than 15 strings QB64 does not have this limitation.
17 Cannot continue. The program while debugging has changed in a way that it cannot continue. QB64 has no debug feature.
18 Function not defined. The function used by the program must be defined. Did you include the .bi file while using a library? none
19 No RESUME. The end of the program was reached while being in a error handling routine, add a RESUME at the end of the routine. none
20 RESUME without error. RESUME can only be used in an error handler using ON ERROR. none
24 Device timeout. WRITEME none
25 Device fault. WRITEME none
26 FOR without NEXT. Look for a missing END IF statement also. none
27 Out of paper A printer paper error when using LPRINT. none
29 WHILE without WEND. WEND must be used with WHILE none
30 WEND without WHILE Look for an END IF error also. none
33 Duplicate label Line numbers or labels cannot be used twice in a procedure. none
35 Subprogram not defined. Often occurs when the Quickbasic Library is not used with CALL ABSOLUTE or INTERRUPT. none
37 Argument-count mismatch The number of sub-procedure parameters do not match the call. none
38 Array not defined Arrays using more than 10 elements must be DIMensioned. none
40 Variable required. A GET or PUT statement must specify a variable when operating with a file opened in binary mode. none
50 FIELD overflow. A FIELD statement tried to allocate more bytes than were specified for the record length of a random access file. none
51 Internal error. An internal malfunction occured in QuickBASIC or QB64. none
52 Bad file name or number. The filename must follow the rules for filenames in the OS and filenumbers must be between 1 and 255 and reffer to a currently open file. none
53 File not found. File not in current directory. none
54 Bad file mode. File access mode does not match file procedure. none
55 File already open. CLOSE a file to open it in a different mode. none
56 FIELD statement active. WRITEME none
57 Device I/O error. WRITEME none
58 File already exists. The filename specified in the NAME statement was identical to a file that already exists. none
59 Bad record length. WRITEME none
61 Disk full. The amount of data to write to the disk was more than the free space available, remove some files you don't need and try again. none
62 Input past end of file. Check for the end of file with EOF. none
63 Bad record number. WRITEME none
64 Bad file name File name contains illegal characters or exceeds 12 characters. none
67 Too many files Over 15 files are open. none
68 Device unavailable. WRITEME none
69 Communication-buffer overflow. WRITEME none
70 Permission denied A file or port is in use on a network, blocked, read only or locked. none
71 Disk not ready. WRITEME none
72 Disk-media error. WRITEME none
73 Feature unavailable. Based on the DOS version available. none
74 Rename across disks. WRITEME none
75 Path/File access error. File or path cannot be accessed. none
76 Path not found. Path is not accessable. none
97 (no error message) Can be used to trigger an error trap event with ERROR 97, nothing else will cause this error, so create your own errors for ON ERROR. none
QB64-specific error codes
Code Description Common cause/resolution QB64 differences
258 Invalid handle The handle has not been created for use by the calling sub or function. N/A


See also


Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage