Often your program has to check the results of functions and do different things if errors have occurred.
For instance, if you try to open a window (using OpenW
), you may get a NIL
pointer returned which shows that the window could not be opened for some reason.
In this case you normally can't continue with the program, so you must tidy up and terminate.
Tidying up can sometimes involve closing windows, screens and libraries, so sometimes your error cases can make your program cluttered and messy.
This is where exceptions come in--an exception is simply an error case, and exception handling is dealing with error cases.
The exception handling in E neatly separates error specific code from the real code of your program.
Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.