| Home Introduction Using Holon Holon Tools Contact
HolonJForth |
Exceptions
HolonJ implements the Java exception handling mechanism with Try, Catch, Throw, and CatchAll. Syntax:
Example:
The event object is delivered on TOS. The method getMessage of java.lang.Throwable retrieves an exception message from the object. CatchAll starts an exception handler, which catches all exceptions. The exception object is on TOS, when the handler is called. The name of the exception can be determined with the method toString.
A nice exception handler during debugging is "toString type". It tells you all about the exceptions that happen. Throw creates a new exception object and calls athrow.
HolonJ is restricted to one Catch or CatchAll handler in the same word (method). The finally clause is not implemented.
|
|
| © 1999-2005 Wolf Wejgaard |