Maybe I'm missing it, but I don't see where the RmvMsg subprocedure is called.
Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email:  jerry@xxxxxxxxxxxxxxx
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buzz Fenner
Sent: Wednesday, September 03, 2008 11:34 AM
To: Discussion RPG
Subject: QMHSNDPM, QMHRMVPM, & Error Message Subfiles
To begin, I've looked through the archives and have not found a solution to
the problem I'm having.  Secondly, this is my 1st attempt at using error
message subfiles (in RPG) and the two APIs.  I coded the two APIs in
subprocedure calls in the main program.  I'll eventually incorporate them
into a service program, but I wanted to keep it simple to begin with.
The user is presented with a subfile (in a window) where they enter check
numbers, which are then validated.  A single check number can generate
numerous errors, hence the perfect "excuse" to use an error message subfile.
Field PgmPgmQ (in the DDS) is set to the PEP procedure name.  The sending
and displaying of the messages work perfectly - that is only on the first
pass.  Using QMHRMVPM to clear the queue (prior to re-validating the input
on subsequent passes) does not appear to be working.  Checking the error API
data structure in debug mode reveals nothing at all.  So, each time the
check numbers get validated, the error messages pile up in the subfile
message queue.  Here's some snippets of the code:
The DDS:
     A          R ERRSFL                    SFL
     A                                      SFLMSGRCD(8)
     A            MSGKEY                    SFLMSGKEY
     A            PGMPGMQ                   SFLPGMQ(276)
     A          R ERRCTL                    SFLCTL(ERRSFL) OVERLAY
     A                                      WINDOW(NTRKEY)
     A                                      LOCK
     A                                      SFLSIZ(50) SFLPAG(1)
     A  03                                  SFLEND
     A  03                                  SFLDSP
     A  03                                  SFLDSPCTL
     A  03                                  SFLINZ
     A            PGMPGMQ                   SFLPGMQ(276)
The subprocedures:
     P ErrMsg          b
     D ErrMsg          pi
     D  pChkNbr                       7s 0 const
     D  pErrTxt                     256a   const options(*varsize)
     D SndPgmMsg       pr                  ExtPgm('QMHSNDPM')
     D   MessageID                    7a   Const
     D   QualMsgF                    20a   Const
     D   MsgData                    256a   Const
     D   MsgDtaLen                   10i 0 Const
     D   MsgType                     10a   Const
     D   CallStkEnt                 276a   Const
     D   CallStkCnt                  10i 0 Const
     D   MessageKey                   4a
     D   ErrorCode                         likeds(dsEC)
     D wwMsgLen        s             10i 0
     D wwTheKey        s              4a
     D errTxt          s            256a
     C                   eval      errTxt = '#' + %char(pChkNbr) + '- '
     C                               + pErrTxt
     C     ' '           checkr    errTxt        wwMsgLen
     C                   callp     SndPgmMsg('CPF9897': 'QCPFMSG   *LIBL':
     C                               errTxt: wwMsgLen: '*INFO':'*CTLBDY':
     C                               0: wwTheKey: dsEC)
     P                 e
      *---------------------------------------------------------------------
----
     P RmvMsg          b
     D RmvMsg          pi
     D RmvPgmMsg       pr                  ExtPgm('QMHRMVPM')
     D   CallStkEnt                 276a   Const
     D   CallStkCnt                  10i 0 Const
     D   MessageKey                   4a   Const
     D   MsgToRemove                 10a   Const
     D   ErrorCode                         likeds(dsEC)
     C                   callp     RmvPgmMsg('*':0:'    ':'*ALL':dsEC)
     P                 e
It's probably something trivial...what I need is a really good primer on using
the message handling API's with error message subfiles.  Thanks.
Buzz Fenner
Systems Analyst/Network Administrator
870.930.3374
mailto:bfenner@xxxxxxxxxxxxxxxx <mailto:bfenner@xxxxxxxxxxxxxxxx>
--
 PRIVACY WARNING: For auditing purposes, a copy of this message has been
 saved in a permanent database.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: 
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at 
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.