This shows you the differences between two versions of the page.
— |
pt:errorcodes [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Códigos de erro ==== | ||
+ | |||
+ | ==== Descrição ==== | ||
+ | |||
+ | Esta é uma lista de números de código de erro de tempo de execução devolvidos pelo [[lasterror|LastError]] e mensagens de erro de função, bem como o texto (traduzido) devolvido pelo [[Lasterrormessage|Função de LastErrorMessage]]. | ||
+ | |||
+ | |Erro # | |Erro (descrição) | | ||
+ | |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|" | ||
+ | < | ||
+ | # 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 | ||
+ | </ | ||
+ | |||
+ | ==== Ver também ==== | ||
+ | [[Lasterror|Lasterror]], | ||