Remote-processing CAMBASIC Manuale Utente Pagina 119

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 208
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 118
Commands - 86
ON ERR GOTO
Statement
SYNTAX: ON ERR GOTO line/label
PURPOSE: To enable error trapping and specify the first line of the error handling subroutine.
REMARK S: Once error trapping has been enabled, all error s detected by CAMBASIC during run tim e cause
CAMBASIC to branch to the specified line.
To disable error trapping, execute an ON ERR without the line number. If the routine beginning at
line has an error, an infinite loop will be set up. In this case, do a hardware reset and execute the
UNNEW! command. The error trapping subroutine should be tested before executing an ON ERR
statement.
The ON ER R GO TO line statement m ust be performed ever y time an er ror occurs if yo u wish to
continue to trap on errors. The best place to do this is in the error handling routine.
RELATED: RESUME, RESUME NEXT
EXAMPLE: 10 ON ERR GOTO 100
20 A=5/0
30 END
100 PRINT "DIV BY ZERO"
110 ON ERR GOTO 100
120 RESUME NEXT
In this case just using RESUM E without the NEXT would cause line 20 to be executed again,
producing another error.
10 ON ERR GOTO : 'disable error trapping
ERROR: < Can’t compile> if line/label does not exist
Vedere la pagina 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 207 208

Commenti su questo manuale

Nessun commento