Run-Time Errors
Overview
A number of things can cause run-time errors, such a shortage of system memory, an invalid parameter in a mnemonic argument list, or a valid command being issued at the wrong time. These can be trapped with the standard BASIC ERR= branch.
Communication with the GUI system consists of three essential operations: printing to the SYSGUI channel directly, querying SYSGUI status with the CTRL() and FIN() functions, and READing the event queue. In the case of CTRL(), FIN(), and READ, the error codes that are returned from the SYSGUI device are typical of those returned from other PRO/5 devices.
In the case of errors encountered during a WRITE or PRINT to the SYSGUI channel, these are almost always returned as an !ERROR=29, with a more detailed error code in the TCB(10) value. If an error is reported from within the language (and not from the operating system), a positive TCB(10) value is typically returned, whose value is one greater than the standard error code. For example, a memory shortage might cause !ERROR=33, with TCB(10) equal to 34.
These rules apply equally to errors encountered while writing to the SYSGUI device, except that the main error code will be !ERROR=29. Therefore, one example is if the GUI system runs out of memory, it will report !ERROR=29, with TCB(10) equal to 34.