|
Hi Birgitta,You can't monitor for certain message ids, and ignore others, in RPG the way you can in CL. Sure, you can monitor for all messages, then retrieve the message id, and re-send the message. (as you demonstrated) but it's a lot more work, and leads to more awkward looking code, IMHO.
I've already done the same thing that you did, except that I used the resend escape message (QMHRSNEM) API instead of just sending a new program message, but I still think RPG can do better.
BirgittaHauser wrote:
Hi, May be I misunderstood. But isn't this already available?I solved this by sending escape messages (with a wrapper procecude aroundQMHSNDPM) to the previous callstack. The message id and the complete message text (atleast the first 70 characters) can be retrieved from the program status data structure. In this way I can handle different MSGIDs in different ways. Example: Called Procedure: SendEscMsg('MSG4711'); Caller Monitor; Called(Parm1: Parm2); On-Error; Select; When SDSMsgId = 'MSG4711'; //Do Something When SDSMsgId = 'MSG4712'; //Do Something else; Other; SndEscMsg(SDSMsgId); EndSL;EndMon;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.