ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

DDS SNGCHCFLD Compile Error

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

  • DDS SNGCHCFLD Compile Error

    Hi, all. I'm trying to give the user radio buttons to select one of up to 10 choices for a field value. The DDS compiler is giving me error "CPD8186" (Field extends outside window/pull down...).

    I'm using the SNGCHCFLD keyword in a window. (I've already encountered the bug (?) that requires compiling with RSTDSP(*YES) to avoid a RNX1251 runtime error.) The window is 56 characters wide, and the text for each choice is very short (2 characters). I'm setting the *NUMCOL parameter for SNGCHCFLD to "5" and the *GUTTER parameter to "2" to present the choices on two lines.

    When I list 9 choices, there is no problem. The DDS is in part as follows:

    Code:
         A          R DR02W1056F
         A                                      WINDOW(3 11 10 56
         A                                      *NOMSGLIN *RSTCSR)
         A                                      WDWBORDER((*CHAR '        ') -
         A                                      (*DSPATR RI))
         A                                      WDWTITLE((*TEXT &W1056TITL) -
         A                                      (*COLOR WHT) (*DSPATR UL) +
         A                                      *CENTER *TOP)
         A    .
         A    .
         A    .
         A          R DR02W06
         A                                      WINDOW(DR02W1056F)
         A                                      OVERLAY
         A                                      CF04(04 'Prompt')
         A                                      CF12(12 'Cancel')
         A                                      RTNCSRLOC(*RECNAME
         A                                      &W6CSRREC &W6CSRFLD)
         A            W6CSRREC      10A  H
         A            W6CSRFLD      10A  H
         A                                  1  2'Provide required tag informa-
         A                                      tion, then press <Enter>.'
         A                                      COLOR(BLU)
         A                                  2 12'Tag Purchase Date:'
         A                                      DSPATR(HI)
         A    .
         A    .
         A    .
         A                                  6 09'Tag Term2:'
         A                                      DSPATR(HI)
          *
         A            W6TERMCHC      2Y 0B  7 07SNGCHCFLD(*RSTCSR *AUTOSLT +
         A                                      *SLTIND *NOAUTOENT +
         A                                      (*NUMCOL 5) +
         A                                      (*GUTTER 2))
         A  71                                  CHOICE(1 &W6CHOTERM1)
         A  72                                  CHOICE(2 &W6CHOTERM2)
         A  73                                  CHOICE(3 &W6CHOTERM3)
         A  74                                  CHOICE(4 &W6CHOTERM4)
         A  75                                  CHOICE(5 &W6CHOTERM5)
         A  76                                  CHOICE(6 &W6CHOTERM6)
         A  77                                  CHOICE(7 &W6CHOTERM7)
         A  78                                  CHOICE(8 &W6CHOTERM8)
         A  79                                  CHOICE(9 &W6CHOTERM9)
         A* 80 ****                             CHOICE(10 &W6CHOTERM0)
          * The following fields are assigned the text for each choice.
         A            W6CHOTERM1     2A  P
         A            W6CHOTERM2     2A  P
         A            W6CHOTERM3     2A  P
         A            W6CHOTERM4     2A  P
         A            W6CHOTERM5     2A  P
         A            W6CHOTERM6     2A  P
         A            W6CHOTERM7     2A  P
         A            W6CHOTERM8     2A  P
         A            W6CHOTERM9     2A  P
         A*  ****     W6CHOTERM0     2A  P
          *
         A  49                              9 21'Expires:'
         A                                      DSPATR(HI)
         A  49        W6TEXPIR  R        O  9 31REFFLD(S1RQTEXPIR *SRC)
          *
    And the window appears like this:
    Click image for larger version

Name:	SNGCHCFLD6.JPG
Views:	1
Size:	35.4 KB
ID:	127973

    But when I attempt to add a 10th choice (uncommenting the CHOICE and P-field lines shown above that mention "W6CHOTERM0"), I get the CPD8186 message on field W6TERMCHC.

    This puzzles me, as it would appear that this 10th choice would fit nicely under the 5th choice! Each line of 5 choices, with gutter and all, requires only 28 characters ((5 choices * 4 characters each) + (4 gutters * 2 characters each)).

    BUT, when I changed the starting column of W6TERMCHC from column 7 to column 1, the DSPF compiles OK, and the window appears like this:

    Click image for larger version

Name:	SNGCHCFLD8.JPG
Views:	1
Size:	36.2 KB
ID:	127974

    Has anyone seen similar behavior before, or can anyone suggest what's going on? Most users will probably have only 3 choices, and I hate to have 3 radio buttons skewed so far to the left.

    I'm wondering if there isn't a bug in the DDS compiler whereby it fails to recognize that the choices are arranged on two lines and will fit in the width of the window when I start at column 7. And why does it compile when starting in column 1, even though fitting all the choices on one line would require 58 characters (2 more than the window width)?

    Anyone? Anyone? Bueller?

  • #2
    Re: DDS SNGCHCFLD Compile Error

    Can you supply a bit more of the DDS? The snippet cannot compile because of references to missing DDS elements, e.g., "REFFLD(S1RQTEXPIR *SRC)". I could invent references, but I wouldn't know how they affected parts that have problems. Perhaps only enough to compile is needed.
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      Re: DDS SNGCHCFLD Compile Error

      Thanks, Tom. I think this bare bones version of the DDS should compile with 9 CHOICEs, and not compile with 10 CHOICEs.

      Code:
           A*
           A                                      DSPSIZ(24 80 *DS3)
           A                                      INDARA
           A                                      HELP
           A                                      ALTHELP
            *
           A          R DR02W1056F
           A                                      WINDOW(3 11 10 56
           A                                      *NOMSGLIN *RSTCSR)
           A                                      WDWBORDER((*CHAR '        ') -
           A                                      (*DSPATR RI))
           A                                      WDWTITLE((*TEXT &W1056TITL) -
           A                                      (*COLOR WHT) (*DSPATR UL) +
           A                                      *CENTER *TOP)
           A                                      WDWTITLE((*TEXT +
           A                                      '  F3=Save/Exit    *F4=Prompt    +
           A                                                  ') +
           A                                      (*COLOR WHT) +
           A                                      (*DSPATR UL) *CENTER *BOTTOM)
           A                                      RMVWDW
           A            W1056TITL     32A  P
            *
            * ----------------------------------------------------------------------
           A          R DR02W06
           A                                      WINDOW(DR02W1056F)
           A                                      OVERLAY
           A                                      CF04(04 'Prompt')
           A                                      CF12(12 'Cancel')
           A                                      RTNCSRLOC(*RECNAME
           A                                      &W6CSRREC &W6CSRFLD)
           A            W6CSRREC      10A  H
           A            W6CSRFLD      10A  H
           A                                  1  2'Provide required tag informa-
           A                                      tion, then press Enter.'
           A                                      COLOR(BLU)
           A                                  2 12'Tag Purchase Date:'
           A                                      DSPATR(HI)
           A            W6TAGPDT        L  B  2 31DATFMT(*ISO)
           A                                      MAPVAL(('0001-01-01' *BLANK))
           A                                      DSPATR(&W6TAGPDTP)
           A  41                                  DSPATR(PC RI)
           A                                  3 10'Starting Tag Number:'
           A                                      DSPATR(HI)
           A            W6TAGNUM       5S 0B  3 31
           A                                      CHECK(RB)
           A                                      DSPATR(&W6TAGNUMP)
           A  42                                  DSPATR(PC RI)
           A                                  4 15'Number of Tags:'
           A                                      DSPATR(HI)
           A            W6NUMTAGS      2Y 0B  4 31CHECK(RB)
           A                                      VALNUM
           A                                      EDTCDE(4)
           A                                      DSPATR(&W6NUMTAGSP)
           A  50                                  DSPATR(PC RI)
           A  49                              4 35'Expires:'
           A                                      DSPATR(HI)
           A  49        W6TEXPIR        L  O  4 44
           A                                  5  2'Tag Term:'
           A                                      DSPATR(HI)
            *
           A            W6TERMCHC      2Y 0B  7 07SNGCHCFLD(*RSTCSR *AUTOSLT +
           A                                      *SLTIND *NOAUTOENT +
           A                                      (*NUMCOL 5) +
           A                                      (*GUTTER 2))
           A  71                                  CHOICE(1 &W6CHOTERM1)
           A  72                                  CHOICE(2 &W6CHOTERM2)
           A  73                                  CHOICE(3 &W6CHOTERM3)
           A  74                                  CHOICE(4 &W6CHOTERM4)
           A  75                                  CHOICE(5 &W6CHOTERM5)
           A  76                                  CHOICE(6 &W6CHOTERM6)
           A  77                                  CHOICE(7 &W6CHOTERM7)
           A  78                                  CHOICE(8 &W6CHOTERM8)
           A  79                                  CHOICE(9 &W6CHOTERM9)
           A* 80  ***                             CHOICE(10 &W6CHOTERM0)
            * The following fields are assigned the text for each choice.
           A            W6CHOTERM1     2A  P
           A            W6CHOTERM2     2A  P
           A            W6CHOTERM3     2A  P
           A            W6CHOTERM4     2A  P
           A            W6CHOTERM5     2A  P
           A            W6CHOTERM6     2A  P
           A            W6CHOTERM7     2A  P
           A            W6CHOTERM8     2A  P
           A            W6CHOTERM9     2A  P
           A* *****     W6CHOTERM0     2A  P
            *
           A                                  9  1'Tag Term:'
           A                                      DSPATR(HI)
           A            W6TAGTERM      2A  B  9 11
           A                                      CHECK(RB)
           A                                      DSPATR(&W6TAGTERMP)
           A  43                                  DSPATR(PC RI)
           A            W6TERMINFO    28A  O  9 15
            *
            * -- Display Attribute P-fields for this record --
           A            W6TAGPDTP      1A  P
           A            W6TAGNUMP      1A  P
           A            W6TAGTERMP     1A  P
           A            W6NUMTAGSP     1A  P
            *

      Comment


      • #4
        Re: DDS SNGCHCFLD Compile Error

        The problem appears to be that (*NUMCOL 5) (GUTTER 2) positions the radio buttons in a way that the tenth button interferes with the window.
        If you change it to (*NUMCOL 4) (GUTTER 3) it works fine and you can increase up to 12 buttons without a problem.

        So either resize your window to cope with your extra button within (*NUMCOL 5) (GUTTER 2) OR go for 10 buttons within (*NUMCOL 4) (GUTTER 3).

        Hope I've made that clear :-)

        Neil.
        Bloke

        Comment


        • #5
          Re: DDS SNGCHCFLD Compile Error

          Originally posted by NeilD View Post
          ... (*NUMCOL 5) (GUTTER 2) positions the radio buttons in a way that the tenth button interferes with the window.
          That seems to be the DDS compiler's belief. ;-) Thanks, Neil. Yes; I decided to go with the workaround -- that 9 options was enough, arranged in 3 rows of 3 (which also helps the centering).

          Comment


          • #6
            Re: DDS SNGCHCFLD Compile Error

            No resolution, but FWIW, I have another example, with two columns of 23-character choices. Skip column 1, add a radio button & space before each column, and use a gutter of 4 columns. As I add it, that's 1(skip) + 1 (button) + 1(space) + 23(text) + 4(gutter) + 1(button) + 1(space) + 23(text) = 55 characters. I have to widen the window to 64 (or "gutter+60") characters to avoid the "extends beyond window" message. (But 11 rows, as expected, works OK, with two choices on each of lines 8-11.) I just document this for posterior.

            Code:
                  *   Tag Terms (Radio buttons)
                 A            W6TERMCHC      2Y 0B  8  2SNGCHCFLD(*RSTCSR *AUTOSLT +
                 A                                      *SLTIND *NOAUTOENT +
                 A                                      (*NUMCOL 2) +
                 A                                      (*GUTTER 4))
                  * Requires window to be at least 60+Gutter chars wide
                 A  71                                  CHOICE(1 &W6CHCTERM1)
                 A  72                                  CHOICE(2 &W6CHCTERM2)
                 A  73                                  CHOICE(3 &W6CHCTERM3)
                 A  74                                  CHOICE(4 &W6CHCTERM4)
                 A  75                                  CHOICE(5 &W6CHCTERM5)
                 A  76                                  CHOICE(6 &W6CHCTERM6)
                 A  77                                  CHOICE(7 &W6CHCTERM7)
                 A  78                                  CHOICE(8 &W6CHCTERM8)
                  * The following fields are assigned the text for each choice.
                 A            W6CHCTERM1    23A  P
                 A            W6CHCTERM2    23A  P
                 A            W6CHCTERM3    23A  P
                 A            W6CHCTERM4    23A  P
                 A            W6CHCTERM5    23A  P
                 A            W6CHCTERM6    23A  P
                 A            W6CHCTERM7    23A  P
                 A            W6CHCTERM8    23A  P

            Comment


            • #7
              Re: DDS SNGCHCFLD Compile Error

              Out of curiosity, do you also do testing for non-GUI-capable emulators, e.g., Mocha? I'd wonder if there is some positioning requirement that has to take the alternative formatting into account.
              Tom

              There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

              Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

              Comment


              • #8
                Re: DDS SNGCHCFLD Compile Error

                Good point, Tom. Many of our clients use the "BosaNova" emulator, but that doesn't seem to support some of the capabilities that Client Access supports, and those that it _does_ support aren't always pretty. ;-) So I think it's safe to assume IBM doesn't consider BosaNova ... and I'd have to wonder if/why they'd bother to consider other (even more popular) emulators. But window/field size doesn't seem to be a problem anyway.

                Thanks for your comment! This may be one of those "just accept it" issues.

                Jerry

                FWIW:

                Client Access: Click image for larger version

Name:	FXAMNT01_VendorSelection_ClientAccess.JPG
Views:	1
Size:	103.5 KB
ID:	126704
                BosaNova: Click image for larger version

Name:	FXAMNT01_VendorSelection_BosaNova.jpg
Views:	1
Size:	104.6 KB
ID:	126705

                Comment


                • #9
                  Re: DDS SNGCHCFLD Compile Error

                  Its not that IBM does not consider BosaNova, its that BosaNova does not care about these elements in the 5250 stream.
                  Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

                  Comment


                  • #10
                    Re: DDS SNGCHCFLD Compile Error

                    = I just document this for posterior.
                    posterity?

                    Comment


                    • #11
                      Re: DDS SNGCHCFLD Compile Error

                      If you prefer. ;-)

                      Comment


                      • #12
                        Re: DDS SNGCHCFLD Compile Error

                        Originally posted by davidjurban View Post
                        posterity?
                        If you prefer. ;-)

                        Comment

                        Working...
                        X