Denso Power Net Terminal BHT-7500 Dokumentacja Strona 168

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 560
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 167
Chapter 9. Event Polling and Error/Event Trapping
159
[ 2 ] Programming for trapping errors
To trap errors, use the ON ERROR GOTO statement in which you should designate the error-
handling routine (to which control is to be transferred if a run-time error occurs) by the label.
ON ERROR GOTO err01
.
.
.
(Main routine)
.
.
.
END
err01
(Error-handling routine)
PRINT"*** error ***"
PRINTERR,HEX$(ERL)
RESUME NEXT
If a run-time error occurs in the main routine, the above program executes the error-handling
routine specified by label err01 in the
ON ERROR GOTO statement.
In the error-handling routine, the ERL and ERR functions allow you to pinpoint the address
where the error has occurred and the error code, respectively.
The RESUME statement may pass control from the error-handling routine back to any specified
statement as listed below.
NOTE
According to the error location and error code, you should troubleshoot the program-
ming error and correct it for proper error handling.
RESUME
Statement
Description
RESUME or RESUME 0
Resumes program execution with the statement
that caused the error.
RESUME NEXT
Resumes program execution with the statement
immediately following the one that caused the
error.
RESUME label
Resumes program execution with the statement
designated by label.
Przeglądanie stron 167
1 2 ... 163 164 165 166 167 168 169 170 171 172 173 ... 559 560

Komentarze do niniejszej Instrukcji

Brak uwag