| 
    
mi400-bounces@xxxxxxxxxxxx wrote on 05/18/2004 07:46:36 AM:
> I am basically doing an "IF Object Exists" test in an RPG IV program by
> calling a C function that evokes rslvsp.
> When the object does not exist, a signal handler is evoked and I return 
a
> *NULL value to the caller. When it does exist, I return the system 
pointer.
> Where I'm lost is how to filter/remove the MCH3401 message so that the 
user
> doesn't see it in their joblog. I want to do this because they may be
> calling this procedure 1000's of times and that would just clutter 
things
> up.
> Is there a way to filter out messages without doing a dynamic call to 
one of
> the QMHxxxxx message APIs?
> -Bob Cozzi
If you choose to use a signal handler, you'll need to use the message 
handler APIs (in particular, QMHCHGEM).
>From C, a simpler and more efficient option, especially if the exception 
path is take with some regularity, is to replace the signal handler with a 
branch-point exception handler that removes messages from the job log. For 
example:
    #include <stddef.h>
    #include <except.h>
    #include <pointer.h>
    #include <mih/rslvsp.h>
    _SYSPTR checkObj( ... ) 
    {
      _SYSPTR obj = NULL;
      obj = NULL;
      _VBDY();
      #pragma exception_handler (EH_LBL,   \
                 0,  _C1_ALL, _C2_ALL, _CTLA_HANDLE_NO_MSG )
      obj = rslvsp( ... );
      #pragma disable_handler
     EH_LBL:
      return obj;
    }
Any follow-up questions should probably go to the C400-L.
Bob Donovan, rjd@xxxxxxxxxx
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.