× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Question on SNDPGMMSG in a "menu" CL
  • From: watern@xxxxxxxxxxxxxx
  • Date: Mon, 25 Oct 1999 12:15:53 -0400

Hi Chuck,

If your "menu" cl is using a normal display file, you should be able to
create a message subfile within the display file and use that in the same
way that you can use it within an rpg program. You can then use the
sndpgmmsg to send a message to the program msgq, which will display it on
the menu.

After the job is submitted, before the screen is redisplayed, send a
message indicating what has happened.

You could probably get clever and do a rcvmsg after the sbmjob, and resend
the received message back to the display. Alternatively, if you do not use
the rmvmsg command, you may even see the message automatically, depending
on what other messages are in the program msgq. A little bit of
experimenting will show you what you need to do.


If you have not used message subfile before, the basics steps are:

clear the pgm msgq.  (do a "RMVMSG     PGMQ(*PRV) CLEAR(*ALL)")
do until exit requested
    write the msg subfile control format
    exfmt  screen record format
    clear the pgm msgq
    .... process the screen
    .... sndpgmmsg  (SNDPGMMSG  MSGID(&MSGID) MSGF(&LIB/&MSGF)
MSGDTA(&MSGDTA))
enddo


the DDS for the message subfile looks something like:
          R MSGSFL                    SFL
                                      SFLMSGRCD(24)
            MSGKEY                    SFLMSGKEY
            PGMQ                      SFLPGMQ
          R MSGCTL                    SFLCTL(MSGSFL)
                                      SFLDSP SFLDSPCTL
 N99                                  SFLINZ SFLEND
                                      SFLSIZ(2) SFLPAG(1)
            PGMQ                      SFLPGMQ

In your program, set the field PGMQ equal to the program name - the best
way of doing this is to retrieve it from the pgm status data structure,
then you have standard code that you can copy from program to program with
no amendments required.

Ind 99 should be off.  I am not quite sure why it is there...

hth
Nigel


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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