User Tools

Site Tools


en:errorcodesconstants

This is an old revision of the document!


Error Codes

Description

This is a list of runtime error code numbers returned by the LastError function and text error messages returned by the LastErrorMessage function.

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

Example

# 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 

See Also

en/errorcodesconstants.1451777818.txt.gz · Last modified: 2020/02/28 10:46 (external edit)