× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2019-02-17 6:45 PM, Craig Richards wrote:
A few other things you end up having to think about when you start using
sub-procedures:

- You now want to return a value to be sensibly used in an expression -
but how do you tell the caller when something goes wrong?
- Generally I THROW an error in the sub-procedure and catch it in a
monitor block surrounding the sub procedure call (at some level) If you
haven't seen this technique before it's a nice one to know.

Another related way to handle this issue is to also add an optional parameter to receive error information. If the parameter isn't passed, send the exception.

Here's an RPG Cafe blog post I wrote about this issue a few years ago.
https://www.ibm.com/developerworks/community/blogs/b542d3ac-0785-4b6f-8e53-f72051460822/entry/return_code_or_exception?lang=en


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.