× 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.



Buck,

Your proposing to catch all exceptions and then test the message id to
determine how the catching proc should handle the error.  That works ok, but
it is not what "exception" handling is all about.  It removes the element of
"a proc does only what it has been coded to do" from your code.

The exception being thrown may be intended for a higher up the call stack
proc, in which case the proc should just end and rpg should implicitly
promote the exception.

An example is the case of a proc which is prompting a user for information.
The user presses the "return to the main menu" command key.  The prompting
proc should be able to send an "USR0805 - return back to main menu"
exception msg back to its caller. The caller does not handle such an
exception so it ends itself in an orderly way ( runs its destructor code
that rpg does not have ) and promotes the message. This process repeats
until the main menu proc is return to which does "catch" that "return to
main menu" exception msg.

Granted, this is all pie in the sky.  RPG does not allow procs to have
associated destructors, something that would close open files, free
allocated memory when a proc is exited.  But it is also not rocket science
and its absence from RPG makes our apps buggier than they would be if RPG
had such modular programming capability.

Steve



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.