John Hall wrote:
>Hans have you looked at how Delphi traps errors.
>
>Try
> ...
>except
> ...
>end;
>
>or
>
>Try
> ....
>finally
> ....
>end;
>
>The latter is used when you know you need to do something regardless of
>an error condition or not.
As I understand the "finally" clause, the only real benefit from
that is it defines some code which is guaranteed to run even if
there is a return from the "catch" clause. Without such a clause,
the functionality can be simulated easily enough anyways.
>
>The "on-error 103" statement - does that mean that you will trap error #
>103 and no others ?
Yes.
>
>I hope you can set it up like cl so you can trap one, some, all
>exceptions.
Yes. The on-error statement takes a list of RPG status codes.
You can monitor for any RPG error/exception code, plus *FILE,
*PROGRAM, and *ALL. I believe leaving the list blank defaults
to *ALL. Also, you can have several ON-ERROR sections within
one MONITOR group so you can handle different exceptions
differently if you want.
>
>Also it would be nice to be able to raise the exception (so that normal
>error handling could take place if that is more appropriate (as if no
>monitoring was in place).
We're not planning any special syntax in RPG for signalling
exceptions.
>
>I am really looking forward to the improvements you guys are doing to
>the language
Cheers! Hans
Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List! To submit a new *
* message, send your mail to "RPG400-L@midrange.com". To unsubscribe *
* from this list send email to MAJORDOMO@midrange.com and specify *
* 'unsubscribe RPG400-L' in the body of your message. Questions should *
* be directed to the list owner / operator: david@midrange.com *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *