The SndMsg procedure sends an impromptu (ad hoc) program message.
The SndMsg procedure uses user-supplied text to compose and send a program message.
msgKey SndMsg( szMsgText 1024A Const Varying szMsgType 10A Const OPTIONS(*OMIT : *NOPASS : *VARSIZE ) szToPgmQ 10A Const OPTIONS(*OMIT : *NOPASS : *VARSIZE ) ) |
|
See also: SndMsgID, SndStsMsg, GetMsgText, GetMsgInfo |
| Message Type | Description |
| '*COMP' | Completion message |
| '*DIAG' | Diagnostic message |
| '*ESCAPE' | Escape message |
| '*INFO' | Informational message |
| '*INQ' | Inquiry message (valid only when *EXT is specified for szToPgmQ |
| '*NOTIFY' | Notification message |
| '*RQS' | Request message |
| '*STATUS' | Status message |
| *OMIT | If *OMIT (not enclosed in quotes) is specified, the default for this parameter is used. |
| '*' | If '*' is specified, the default value for this parameter is used. |
| ToPgmQ | Description |
| '*' | The current program message queue |
| '*SAME' | Same as * |
| '*PRV' | Previous procedure message queue |
| '*PRVPGM' | Previous program message queue |
| '*CTLBDY' | Control boundary |
| '*EXT' | External program message queue (used for *STATUS messages) |
The return value is the message key of the message once it is sent.
D MSGText C Const('Customer Not found.')
C eval SndMsg(msgtext: '*DIAG':'*PRVPGM')
In this example the message text 'Customer Not Found.' is sent as an diagnostic message to previous program in the call stack.