RMVLSTMSG REMOVE LAST MESSAGE TAAMSHI |
The Remove Last message command can be used as a command in a CL
program, but is intended to be called from a HLL program. The
function removes the last message received in a HLL program's message
queue.
For example, if RPG receives a function check message that is being
handled by the program, you can remove the message as follows:
C CALL 'QCMDEXC' 20 Execute
C PARM CMD Command
C PARM 500 CMDLEN 155 Length
C 20 DO If error
C*
C* Error handling code
C*
C* Get rid of escape message with TAA Tool RMVLSTMSG
C CALL 'RMVLST' RMVLSTMSG
C ENDDO If error
Another good tool to use when dealing with errors in RPG is the
RPGSTSDS tool. It provides an externally described data structure
for the RPG status information. This will allow you to access such
things as the message ID and the message text following an error.
For example, your code could look like:
IPGMSTS ESDSTAARPGEP
.
C CALL yyy 20
C 20 DO If error
C* Access message ID
C MOVE STMSID xxxx
C* Access message text
C MOVE STMSG xxxx
While not intended to be used in a CL program (you should use RCVMSG
MSGTYPE(*LAST) instead), the command may be entered as:
RMVLSTMSG
Command parameters *CMD
------------------
None.
Restrictions
------------
The command may only be used in a CL program. The CPP may be called
from any program.
Prerequisites
-------------
None.
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RMVLSTMSG *CMD TAAMSHI QATTCMD
RMVLST *PGM CLP TAAMSHIC QATTCL
|
Added to TAA Productivity tools May 1, 1996