ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SNDPGMMSG *INQ response

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SNDPGMMSG *INQ response

    Hi,
    I'm trying to send a user, whom has requested a particular function, a message and my program needs to receive the response so I'm using RCVMSG but, which parameter of this command will the response be in?
    Everyday's a school day, what grade are you in?

  • #2
    Re: SNDPGMMSG *INQ response

    If you know the userid for the user then just use SNDUSRMSG

    Code:
    SNDUSRMSG 
                  MSG('Dude - are you shore about that? (Y/N)')
                  VALUES(Y N)                                  
                  DFT(N)                                       
                  MSGRPY(&USRREPLY)
    Greg Craill: "Life's hard - Get a helmet !!"

    Comment


    • #3
      Re: SNDPGMMSG *INQ response

      You can also use RCVMSG as shown below.

      Code:
      dcl &msgkey  *char     4                                
      dcl &rpy     *char     1   ' '                          
                                                                  
      SNDPGMMSG MSG('Dude - are you fond of pie cake ? (Y/N)') +   
                 TOUSR(*REQUESTER)  KEYVAR([COLOR="Red"]&msgkey[/COLOR]) MSGTYPE(*INQ) 
                                                                  
      RCVMSG MSGTYPE(*RPY) MSGKEY([COLOR="Red"]&msgkey[/COLOR]) WAIT(1) MSG(&rpy)      
                                                                  
      if (&rpy = ' ') do                                          
        /* Default reply */                                       
        sndpgmmsg 'default reply'  
       ...
      Philippe

      Comment


      • #4
        Re: SNDPGMMSG *INQ response

        Thank you both.
        Everyday's a school day, what grade are you in?

        Comment


        • #5
          Re: SNDPGMMSG *INQ response

          Was there a thing a number of years ago that if you pressed F12 it would put a null character in the field? I seem to recall learning something like that at a CL session at COMMON a number of years ago (late 90s). I see that it doesn't do that now -- it puts in the default.
          http://www.linkedin.com/in/chippermiller

          Comment


          • #6
            Re: SNDPGMMSG *INQ response

            Now I think thats what the version upgrades has done to iSeries. And yes its alwys good to hear such problems it has. Programmer Must be attentive to handle these things in program, right?

            Comment

            Working...
            X