This is an old revision of the document!
This is a list of runtime error code numbers returned by the LastError function and text error messages returned by the LastErrorMessage function.
Error # | Error Description | |
-1 | ERROR_NOSUCHLABEL | “No such label” |
-2 | ERROR_NEXTNOFOR | “Next without FOR” |
-3 | ERROR_NOTARRAY | “Not an array variable” |
-4 | ERROR_ARGUMENTCOUNT | “Number of arguments passed does not match FUNCTION/SUBROUTINE definition.” |
-5 | ERROR_MAXRECURSE | Maximum levels of recursion exceeded. |
-6 | ERROR_STACKUNDERFLOW |
Error # | Error Description | |
2 | ERROR_FOR1 | “Illegal FOR – start number > end number” |
3 | ERROR_FOR2 | “Illegal FOR – start number < end number” |
5 | ERROR_FILENUMBER | “Invalid File Number” |
6 | ERROR_FILEOPEN | “Unable to open file” |
7 | ERROR_FILENOTOPEN | “File not open.” |
8 | ERROR_FILEWRITE | “Unable to write to file” |
9 | ERROR_FILERESET | “Unable to reset file” |
10 | ERROR_ARRAYSIZELARGE | “Array dimension too large” |
11 | ERROR_ARRAYSIZESMALL | “Array dimension too small” |
12 | ERROR_NOSUCHVARIABLE | “Unknown variable” |
13 | ERROR_VARNOTASSIGNED | |
15 | ERROR_ARRAYINDEX | “Array index out of bounds” |
16 | ERROR_STRNEGLEN | “Substring length less that zero” |
17 | ERROR_STRSTART | “Starting position less than zero” |
19 | ERROR_NONNUMERIC | “Non-numeric value in numeric expression” |
20 | ERROR_RGB | “RGB Color values must be in the range of 0 to 255.” |
21 | ERROR_PUTBITFORMAT | “String input to putbit incorrect.” |
22 | ERROR_POLYARRAY | “Argument not an array for poly()/stamp()“ |
23 | ERROR_POLYPOINTS | “Not enough points in array for poly()/stamp()“ |
24 | ERROR_IMAGEFILE | “Unable to load image file.” |
25 | ERROR_SPRITENUMBER | “Sprite number out of range.” |
26 | ERROR_SPRITENA | “Sprite has not been assigned.” |
27 | ERROR_SPRITESLICE | “Unable to slice image.” |
28 | ERROR_FOLDER | “Invalid directory name.” |
29 | ERROR_INFINITY | |
30 | ERROR_DBOPEN | “Unable to open SQLITE database.” |
31 | ERROR_DBQUERY | “Database query error (message follows).” |
32 | ERROR_DBNOTOPEN | “Database must be opened first.” |
33 | ERROR_DBCOLNO | “Column number out of range.” |
34 | ERROR_DBNOTSET | “Record set must be opened first.” |
35 | ERROR_TYPECONV | |
36 | ERROR_NETSOCK | “Error opening network socket.” |
37 | ERROR_NETHOST | “Error finding network host.” |
38 | ERROR_NETCONN | “Unable to connect to network host.” |
39 | ERROR_NETREAD | “Unable to read from network connection.” |
40 | ERROR_NETNONE | “Network connection has not been opened.” |
41 | ERROR_NETWRITE | “Unable to write to network connection.” |
42 | ERROR_NETSOCKOPT | “Unable to set network socket options.” |
43 | ERROR_NETBIND | “Unable to bind network socket.” |
44 | ERROR_NETACCEPT | “Unable to accept network connection.” |
45 | ERROR_NETSOCKNUMBER | “Invalid Socket Number” |
46 | ERROR_PERMISSION | “You do not have permission to use this statement/function.” |
47 | ERROR_IMAGESAVETYPE | “Invalid image save type.” |
50 | ERROR_DIVZERO | Division by zero. |
51 | ERROR_BYREF | |
52 | ERROR_BYREFTYPE | |
53 | ERROR_FREEFILE | |
54 | ERROR_FREENET | |
55 | ERROR_FREEDB | |
56 | ERROR_DBCONNNUMBER | |
57 | ERROR_FREEDBSET | |
58 | ERROR_DBSETNUMBER | |
59 | ERROR_DBNOTSETROW | |
60 | ERROR_PENWIDTH | |
61 | ERROR_COLORNUMBER | |
62 | ERROR_ARRAYINDEXMISSING | |
63 | ERROR_IMAGESCALE | |
64 | ERROR_FONTSIZE | |
65 | ERROR_FONTWEIGHT | |
66 | ERROR_RADIXSTRING | |
67 | ERROR_RADIX | |
68 | ERROR_LOGRANGE | |
69 | ERROR_STRINGMAXLEN | |
70 | ERROR_NOTANUMBER | |
71 | ERROR_PRINTERNOTON | |
72 | ERROR_PRINTERNOTOFF | |
73 | ERROR_PRINTEROPEN | |
74 | ERROR_WAVFILEFORMAT | |
75 | ERROR_WAVNOTOPEN | |
76 | ||
77 | ||
78 | ||
79 | ||
65535 | ERROR_NOTIMPLEMENTED | “Feature not implemented in this environment.” |
Error # | Error Description | |
65571 | WARNING_TYPECONV | |
65612 | WARNING_WAVNOTSEEKABLE | |
65613 | WARNING_WAVNODURATION | |
65549 | WARNING_VARNOTASSIGNED |
# test error trapping onerror nicetrap print 1 next haha print 2 open 999, "bogus.file" print "Runs Anyway" # test error trapping off and fail at any error (default) offerror print 3 next hoho print "never get here" end nicetrap: # this is the nice error handler print "trap and run - error on line " + lasterrorline + " - error number " + lasterror + " message " + lasterrormessage + " (" + lasterrorextra + ")" return
will display
1 trap and run - error on line 4 - error number 4 message Next without FOR () 2 trap and run - error on line 6 - error number 5 message Invalid File Number () Runs Anyway 3 ERROR on line 12: Next without FOR