|
Hiya Dan,
Doesn't MONMSG allow this functionality already? Couldn't you do this?
ChkObj QSTRUPEX1 *Pgm /* Check for exit program. */
MonMsg MsgId(CPF9800) Exec(DO)
/* handle expected error here */
EndDo
MonMsg MsgId(CPF0000) Exec(DO)
/* Unexpected error.. call QMHRSNEM API to send message +
back to caller ... */
EndDo
Call QSTRUPEX1
MonMsg MsgId(CPF0000) Exec(Do)
/* Handle error or whatever */
EndDo
Ahh, I see the bit about nesting the try/catch. That might not work
with MonMsg as is... though you might be able to get close with a
global monmsg vs. specific monmsg.
Not saying that monmsg is quite as nice as Java's try/catch... but it's
possible to do some of the same stuff, right?
On 7/25/2013 2:23 PM, Dan Kimmel wrote:
A structure that might better represent the original intention might belike this:
try {MonMsg(CPF0000) in the outer try block which does nothing and exits the
try {
ChkObj QSTRUPEX1 *Pgm /* Check for exit program. */
} catch MonMsg(CPF9800) { // no exit program
Throw CPF9800
}
Call QSTRUPEX1 /* Run it. */
} catch MonMsg(CPF0000) {
// do nothing
} finally {
// do nothing
}
Re-throwing the CPF9800 causes the message to be caught by the
block.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.