I think this is what you're looking for:


      * Prototype for the send message API
     D SendMessage     PR                  EXTPGM('QMHSNDPM')
     D  MessageID                     7A
     D  MsgFileLib                   20A
     D  MsgData                      80A
     D  MsgDataLen                   10I 0
     D  MsgType                      10A
     D  MsgCallStack                 10A
     D  MsgStackCount                10I 0
     D  MsgKey                        4A
     D  MsgErrCode                  100A

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Larry Ducie
Sent: Monday, February 06, 2006 2:18 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: communicating with messages

Hi,
 
I read an atricle a while back which put forward the idea of emulating
try/catch blocks by using the message APIs.
 
The kind of thing I'm looking at is the possibility of wrapping a call
to a
procedure in a monitor block and within the called procedure, upon
certain
conditions, send a message up the stack to force the monitor group to
activate a particular on-error condition.
 
Sort of...
 
/free
 
 monitor;
 
 // process task...
 processTask();
 
 on-error   TASK_HALTED;
  someCode();
 on-error   TASK_SUSPENDED;
  someOtherCode();
 on-error;
  inTrouble();
 endmon;
 
/end-free
 
 
and in processTask...
 
/free
 
 if haltTaskConditionMet();
  throw('MSG0001');
 endif;
 
 if suspendTaskConditionMet();
  throw('MSG0002');
 endif;
/end-free
 
 
Is this possible? Where would I find examples for this kind of thing?
Does
my question make any sense at all?
 
Cheers
 
Larry Ducie 

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.