Esta é uma lista de números de código de erro de tempo de execução devolvidos pelo LastError e mensagens de erro de função, bem como o texto (traduzido) devolvido pelo Função de LastErrorMessage.
| Erro # | Erro (descrição) | |
| 1 | ERROR_NOSUCHLABEL | “Sem tal rótulo “ |
| 2 | ERROR_FOR1 | “FOR ilegal - iniciar número > terminar o número “ |
| 3 | ERROR_FOR2 | “FOR ilegal - iniciar número < terminar o número “ |
| 4 | ERROR_NEXTNOFOR | “Próximo sem FOR “ |
| 5 | ERROR_FILENUMBER | “Número de arquivo inválido “ |
| 6 | ERROR_FILEOPEN | “Não é possível abrir o arquivo “ |
| 7 | ERROR_FILENOTOPEN | “Arquivo não aberto. “ |
| 8 | ERROR_FILEWRITE | “Não é possível gravar no arquivo “ |
| 9 | ERROR_FILERESET | “Não é possível redefinir o arquivo “ |
| 10 | ERROR_ARRAYSIZELARGE | “Dimensão de matriz muito grande “ |
| 11 | ERROR_ARRAYSIZESMALL | “Dimensão de matriz muito pequena “ |
| 12 | ERROR_NOSUCHVARIABLE | “Variável desconhecida “ |
| 13 | ERROR_NOTARRAY | “Não é uma variável de matriz “ |
| 14 | ERROR_NOTSTRINGARRAY | “Não uma variável de matriz de seqüência de caracteres “ |
| 15 | ERROR_ARRAYINDEX | “Índice de matriz fora dos limites “ |
| 16 | ERROR_STRNEGLEN |
# 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