ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

ERRMSGID in a DSPF WINDOW

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

  • ERRMSGID in a DSPF WINDOW

    I've got a display file record format, that is a WINDOW without a subfile. I'm trying to use ERRMSGID for various errors (on various fields) in that window. I have ERRSFL specified at the file level (and it is working, for other non-window record formats in the same display file), but I can't seem to make the error messages appear in the window -- nor are the fields with the error highlighting.

    Running out of ideas...anyone have a method?

  • #2
    Re: ERRMSGID in a DSPF WINDOW

    Did you want the error messages to display at the bottom of the window or the bottom of the whole display? I have one where the error messages for the window format appear at the bottom of the display by using *NOMSGLIN as an option for the WINDOW keyword, although it appears to ignore the ERRSFL keyword in that instance.

    Comment


    • #3
      Re: ERRMSGID in a DSPF WINDOW

      I'd like them to appear at the bottom of the window.

      I probably should've mentioned this originally...I do have *MSGLIN declared in the WINDOW keyword, explicitly. I originally thought that this might be the problem, but doing so did not make a difference.

      Comment


      • #4
        Re: ERRMSGID in a DSPF WINDOW

        I changed mine to use ERRMSGID and *MSGLIN to see if I could reproduce your issue, but no luck. The field was reverse imaged and the message appeared at the bottom of the window, although it is ignoring the ERRSFL keyword. Are you sure the indicator for the error message is turned on when you redisplay the window format? If that's not the case, then try creating a simple display file to eliminate the possibility of interference with other keywords.

        Comment


        • #5
          Re: ERRMSGID in a DSPF WINDOW

          I tried all of that already. I used debug to make sure the indicator was on; I put together a simple display file (with a minimal attached program), and it still happens.

          It appears to be localized to windows without subfiles. SFLMSGID appears to be working correctly; ERRMSGID is not.

          Comment


          • #6
            Re: ERRMSGID in a DSPF WINDOW

            Could you post the source of the simple display and program that's not working and I could try it on my system?

            Comment


            • #7
              Re: ERRMSGID in a DSPF WINDOW

              Here they are. PMT006R1 and PMT006D1 are a simple RPGLE prompt window, and should have error messages at the bottom of the window. But whatever error I (intentionally) generate, the program properly cycles back around -- and the message is not displayed.

              Thanks for your help.
              Attached Files

              Comment


              • #8
                Re: ERRMSGID in a DSPF WINDOW

                Here they are (it doesn't seem like my last attempt to post them was successful).
                Attached Files

                Comment


                • #9
                  Re: ERRMSGID in a DSPF WINDOW

                  I've tried posting the code as attachments twice now, and it hasn't appeared on the thread. (I'm new at Code400). Here is the display file (at least) as inline text. It doesn't matter which error condition (indicators 31-35) I trigger; the error message in question doesn't appear at the bottom of the window. (There IS a blank line for it at the bottom of the window).

                  Thanks again!

                  100 A*%%TS SD 20160106 135305 BINKOWA REL-V7R1M0 5770-WDS
                  200 A*%%EC
                  300 A DSPSIZ(24 80 *DS3)
                  400 A PRINT
                  500 A ERRSFL
                  600 A ALTHELP(CA01)
                  700 A WDWBORDER((*DSPATR RI) (*CHAR ' -
                  800 A '))
                  900 A CA03
                  1000 A CA12
                  1100 A HELP
                  1200 A R ASSUME
                  1300 A*%%TS SD 20151002 145645 BINKOWA REL-V7R1M0 5770-WDS
                  1400 A ASSUME
                  1500 A 1 3' '
                  1600 A R PMT001
                  1700 A*%%TS SD 20160106 135305 BINKOWA REL-V7R1M0 5770-WDS
                  1800 A CF04
                  1900 A KEEP
                  2000 A BLINK
                  2100 A OVERLAY
                  2200 A PROTECT
                  2300 A WINDOW(&WINLIN &WINPOS 8 53 *MSGLIN)
                  2400 A WDWBORDER((*COLOR GRN) (*DSPATR RI)-
                  2500 A (*CHAR ' '))
                  2600 A RMVWDW
                  2700 A WINLIN 3S 0P
                  2800 A WINPOS 3S 0P
                  2900 A 1 15'Program to Execute Prompt'
                  3000 A COLOR(BLU)
                  3100 A 3 2'Library:'
                  3200 A DSPATR(HI)
                  3300 A $LIB 10A B 3 11
                  3400 A 31 ERRMSGID(SEC0011 *LIBL/SECMSGF)
                  3500 A 35 ERRMSGID(SEC0001 *LIBL/SECMSGF)
                  3600 A 4 4'Program:'
                  3700 A DSPATR(HI)
                  3800 A $PGM 10A B 4 13
                  3900 A 32 ERRMSGID(SEC0012 *LIBL/SECMSGF)
                  4000 A 5 1'Parameters:'
                  4100 A DSPATR(HI)
                  4200 A $PRM1 40A B 5 13
                  4300 A 33 ERRMSGID(SEC0013 *LIBL/SECMSGF)
                  4400 A 34 ERRMSGID(SEC0014 *LIBL/SECMSGF)
                  4500 A $PRM2 40A B 6 13
                  4600 A 33
                  4700 AO 34 DSPATR(RI)
                  4800 A 7 12'F3=Exit F4=Prompt F12=Previous'
                  4900 A COLOR(BLU)
                  * * * * E N D O F S O U R C E * * * *

                  Comment


                  • #10
                    Re: ERRMSGID in a DSPF WINDOW

                    I did some testing and it appears that the RMVWDW keyword is somehow interfering with showing the error messages. When I removed that keyword, everything worked as expected.

                    One other tip: If you want the $PRM2 field to be reverse imaged when there is an error in $PRM1 or $PRM2, then replace the DSPATR(RI) with ERRMSG(' ').

                    Comment


                    • #11
                      Re: ERRMSGID in a DSPF WINDOW

                      Removing the RMVWDW keyword did correct the problem on my end as well; thank you. I'll have an associated problem, in that I really did need to RMVWDW -- but that's a lesser problem, and I'll see what I can do here. (That keyword SHOULDN'T interfere, though).

                      As to $PRM1/$PRM2, $PRM1 and $PRM2 are two halves of a single "field", which either has an error or doesn't. Your solution (I believe) will add a blank line to the error subfile, whereas mine will not. I'll give yours a try, though. Thanks again!

                      Comment


                      • #12
                        Re: ERRMSGID in a DSPF WINDOW

                        The reason for my suggestion was that DSPATR(RI) was not reverse imaging $PRM2 on an error. If it does for you, then by all means do it that way.

                        Comment


                        • #13
                          Re: ERRMSGID in a DSPF WINDOW

                          Ah. I used to have an extra WRITE statement in the RPG, which caused the DSPATR(RI) to show up. I took it out while troubleshooting, and hadn't put it back yet.

                          Comment

                          Working...
                          X