Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Applied links to API system call references

...

Similar to RC_SUSP except that the application's screen has been corrupted and the application should attempt to redraw it. Applications which might find it very difficult to redraw a screen can ask the operating system to preserve it for them before they are pre-empted. This can only take place if there is enough memory to do so - some way of dealing with RC_DRAW is still required. Note, it is also possible for applications to save a particular screen image and restore it later - see OS_Sr in "Miscellaneous useful routines".

...

An Escape condition has been detected. This means <ESC> has been pressed while Escape Detection is enabled. Note the Escape condition must be acknowledged by OS_Esc, otherwise the Escape condition will continue to flag errors - acknowledging Escape is an ideal job for an error handler.

...

However, if file I/O is bound to the keyboard, then file read operations will also be pre-emptable. Primarily the suspendable calls are all file I/O and the delay routine (OS_Dly), but again other calls may be if they take their input from a stream which is opened to the keyboard device. Remember some re-binding may be done by the user using the CLI, covered later in "Standard I/O and the CLI".

...

The system provides four routines to handle errors:

OS_Erh

Set error handler. This call installs a new error handler, returnning the address of the old handler so that it may be re-installed at a later date if required.

OS_Esc

Examine special conditions. This call covers the details of working with the Escape key, which can generate errors if required.

GN_Esp

Return a pointer to a system error message. A subset of error codes have messages associated with them. This call returns an extended pointer to an error message in the operating system ROM, if it exists.

GN_Err

Display system error box. This draws an error box on screen which asks the user to press <ESC> to continue, RC_DRAW or RC_SUSP will be returned. In the case of fatal errors, eg. RC_BAD or RC_HAND, the user is asked to press Q to quit and the routine exits with an RC_QUIT error. The routine always exits with Fc = 1, ie. an error condition.

An error handling routine may be set up by using the system OS_Erh whose specification is:

 

...

Finally, the error handler, rather than the main application, will generally respond to a KILL request in the form of the RC_QUIT code. It must close down it's application using OSusing OS_Bye, but it is first essential to close open resources like files, filters, streams and de-allocate memory. If an application has not properly closed resources, in the form of memory, handles and buffers, will be lost to the system. Files left open will be permantently marked as "In Use" and so cannot be deleted or opened for updating. To regain lost handles and resources to the system, a soft reset must be issued. 
 

...