Remote-processing CAMBASIC Manual do Utilizador Página 77

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 208
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 76
Commands - 44
ERR
System Variable
SYNTAX: n = ERR
PURPOSE: To return the error code associated with an error.
REMARK S: The function returns the error code for the last error. It is usually used in conjunction with the ERL
function.
Error trapping is essential in control applications, where a halt in execution is not tolerable.
See the Err or Messages Chapter for a list of error codes and messages.
RELATED: ERL, ON ERR, RESUM E, ERR statement
EXAMPLE: 10 ON ERR GOTO 50 : ’enable error trapping
20 INPUT"Enter a number to divide by. (0 will cause error) : ",A
30 B=10 / A
40 GOTO 20
50 PRINT"Error#" ; ERR ; "occurred on line#";ERL
60 ON ERR GOTO 50 : ’re-enable error trapping
70 RESUME NEXT : ‘resume at next statement after error
ERROR: none
Vista de página 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 207 208

Comentários a estes Manuais

Sem comentários