|
This does 95% of what I was looking for, but I notice it uses the general purpose CPF9897 message to invoke the on-error code. Do you know if it is possible to send custom-messages and still trap them using on-error?
Sure, that shouldn't be any problem at all... You specify the msgId in the first parm to throw().
Or does the on-error code only look for specific values? I was hoping I could throw an escape message and catch it using on-error code.
on-error catches all message IDs. In fact, that's the problem with it! it doesn't give you a change to specify that some of them are "unhandled", you have to handle them all.
That's why I suggested that you write a routine such as the one I had previously put in the archives tht would propigate unhandled error messages to the caller.
Thinking about it though, I'm starting to doubt whether it would be possible. I suppose I could always do something like:
I'm not following you. Why isn't it possible? Helton's article provides routines that do not require CPF9897. Where are you getting the notion that you must use CPF9897?
If you need to use his routines, then your code should look something like this:
monitor; msgid = ''; doSomething(); on-error; msgid = catch(); endmon; select; when msgid = ''; // no error. do nothing. when msgid = 'MSG0001'; takeCareOfMsg0001(); when msgid = 'MSG0002'; takeCareOfMsg0002(); other; // and unknown error callp ScottsRoutineFromArchivesToPropigateError(); endsl;
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.