ESCAPE Handling
Escapes (!ERROR=127)
While a PRO/5 program is executing, the user may interrupt it. There are many valid reasons for doing this. Just pressing a key or combination of keys on the keyboard can interrupt a program. This is called "ESCAPING". On some systems the Esc (ESCAPE) key is used. Other systems may use different keys. PRO/5 will support whatever escape method the host system provides. Therefore, the programmer should avoid naming a specific key in operator messages.
When an escape takes place PRO/5 will stop executing the program and return to console mode. The RUN verb can be used to resume execution. The programmer may use the SETESC verb to trap escapes. If an escape trap is set then the program will decide what to do if the user escapes. This is useful during critical applications that must finish once they have started.
Although the user may escape at any time, PRO/5 will acknowledge the escape only at the following times:
-
At the start of a verb. One exception is a verb immediately following a BEGIN, CLEAR, RESET, RUN, or START. This allows the programmer a chance to execute a SETESC verb to restore the escape trap since these verbs implicitly reset the escape trap.
-
During execution of an input/output verb to a slow device such as a console or a printer. An I/O operation with a disk file must complete before the escape is acknowledged.
PRO/5 acknowledges an escape by setting !ERROR=127.