This shows you the differences between two versions of the page.
en:errorcodesconstants [2016/01/01 22:40] 127.0.0.1 external edit |
en:errorcodesconstants [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Error Codes ===== | ||
- | |||
- | ==== Description ==== | ||
- | This is a list of runtime error code numbers returned by the [[lasterror|LastError]] function and text error messages returned by the [[Lasterrormessage|LastErrorMessage]] function. | ||
- | |||
- | |Error #||Error Description| | ||
- | |1|ERROR_NOSUCHLABEL|" | ||
- | |2|ERROR_FOR1|" | ||
- | |3|ERROR_FOR2|" | ||
- | |4|ERROR_NEXTNOFOR|" | ||
- | |5|ERROR_FILENUMBER|" | ||
- | |6|ERROR_FILEOPEN|" | ||
- | |7|ERROR_FILENOTOPEN|" | ||
- | |8|ERROR_FILEWRITE|" | ||
- | |9|ERROR_FILERESET|" | ||
- | |10|ERROR_ARRAYSIZELARGE|" | ||
- | |11|ERROR_ARRAYSIZESMALL|" | ||
- | |12|ERROR_NOSUCHVARIABLE|" | ||
- | |13|ERROR_NOTARRAY|" | ||
- | |14|ERROR_NOTSTRINGARRAY|" | ||
- | |15|ERROR_ARRAYINDEX|" | ||
- | |16|ERROR_STRNEGLEN|" | ||
- | |17|ERROR_STRSTART|" | ||
- | |18|ERROR_STREND|" | ||
- | |19|ERROR_NONNUMERIC|" | ||
- | |20|ERROR_RGB|" | ||
- | |21|ERROR_PUTBITFORMAT|" | ||
- | |22|ERROR_POLYARRAY|" | ||
- | |23|ERROR_POLYPOINTS|" | ||
- | |24|ERROR_IMAGEFILE|" | ||
- | |25|ERROR_SPRITENUMBER|" | ||
- | |26|ERROR_SPRITENA|" | ||
- | |27|ERROR_SPRITESLICE|" | ||
- | |28|ERROR_FOLDER|" | ||
- | |29|ERROR_DECIMALMASK|" | ||
- | |30|ERROR_DBOPEN|" | ||
- | |31|ERROR_DBQUERY|" | ||
- | |32|ERROR_DBNOTOPEN|" | ||
- | |33|ERROR_DBCOLNO|" | ||
- | |34|ERROR_DBNOTSET|" | ||
- | |35|ERROR_EXTOPBAD|" | ||
- | |36|ERROR_NETSOCK|" | ||
- | |37|ERROR_NETHOST|" | ||
- | |38|ERROR_NETCONN|" | ||
- | |39|ERROR_NETREAD|" | ||
- | |40|ERROR_NETNONE|" | ||
- | |41|ERROR_NETWRITE|" | ||
- | |42|ERROR_NETSOCKOPT|" | ||
- | |43|ERROR_NETBIND|" | ||
- | |44|ERROR_NETACCEPT|" | ||
- | |45|ERROR_NETSOCKNUMBER|" | ||
- | |46|ERROR_PERMISSION|" | ||
- | |47|ERROR_IMAGESAVETYPE|" | ||
- | |48|ERROR_ARGUMENTCOUNT|" | ||
- | |49|ERROR_MAXRECURSE|Maximum levels of recursion exceeded.| | ||
- | |50|ERROR_DIVZERO|Division by zero.| | ||
- | |9999|ERROR_NOTIMPLEMENTED|" | ||
- | |||
- | ==== Example ==== | ||
- | |||
- | < | ||
- | # test error trapping | ||
- | onerror nicetrap | ||
- | print 1 | ||
- | next haha | ||
- | print 2 | ||
- | open 999, " | ||
- | 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 ==== | ||
- | [[Lasterror|Lasterror]], | ||
- | |||