Exception Handling

Поділитися
Вставка
  • Опубліковано 17 жов 2024
  • Exception handling in Sheerpower intercepts runtime exceptions, allowing a block of code to handle them. Without an exception handler, Sheerpower provides an exception message and either stops execution or retries the offending statement. There are two types of handlers: ATTACHED and DETACHED. ATTACHED handlers, similar to try/catch blocks in other languages, use the WHEN EXCEPTION IN statement followed by a USE block. DETACHED handlers use WHEN EXCEPTION USE, calling a handler routine elsewhere in the program. Related functions include _ERROR, EXTYPE, EXLABEL$, EXTEXT$, and SYSTEXT$, while statements like CONTINUE, RETRY, and CAUSE manage exception handling flow.

КОМЕНТАРІ •