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



How can you create user defined statuses, send and retrieve them?
What if I have message Id 'MSG4711' and 'ERR4711'?

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them?  Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Raul A. Jager W.
Gesendet: Friday, February 23, 2007 12:19
An: RPG programming on the AS400 / iSeries
Betreff: Re: AW: Can you have nested MONITOR statements?


Why not:

  Monitor;
    Called(Parm1: Parm2);
  On-Error 4711;
        //Do Something
  On-Error 4712;
         //Do Something else;
  On-Error;
         SndEscMsg(SDSMsgId);
  EndMon;  

____________________________________________________________________________
____________

BirgittaHauser wrote:

Hi,

May be I misunderstood. But isn't this already available?

I solved this by sending escape messages (with a wrapper procecude 
around
QMHSNDPM) 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;



Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them?  Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
Im
Auftrag von Scott Klement
Gesendet: Thursday, February 22, 2007 19:16
An: RPG programming on the AS400 / iSeries
Betreff: Re: Can you have nested MONITOR statements?


Instead of defining a "block of status codes" for user-written 
applications, I'd prefer to see MONITOR able to monitor for message IDs, 
similar to the way CL's MONMSG is able to check for msgids.

That way, a throw() routine is nothing more than a wrapper for QMHSNDPM 
-- it just sends an escape message from a *MSGF...   Users can create 
and add message descriptions to their own message files as they see fit.

With MONITOR able to trap specific error messages, you'd trap for 
USR0001 (or whatever) to catch the user's errors.   Plus, you'd be able 
to use it with IBM APIs and CL commands that already return escape 
messages with message ids.


Jon Paris wrote:
 

Are you listening Barbara? <grin>  - I do think we need support for a 
an RPG implementation of throw().  The problem right now is that when 
you throw an exception you still need some kind of return code in the 
background because RPG only signals a generic code to Monitor.  There 
are hundreds of available status codes - it would be nice if a block 
was allocated as User Defined and the throw op-code allowed you to 
specify a specific status code that you were signaling.  If I had that 
I'd use it for most everything.
   


 



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.