ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

DSPF with Overlapping Fields

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

  • DSPF with Overlapping Fields

    Hai Friends,

    I am facing one problem in DSPF , i need to Overlap one field exactely over another field , i am using DSPATR(ND) under condition indicator on both the fields.
    But it is not working correctely,second value not showing, plz help me to solve this problem.

    Albert

  • #2
    Re: DSPF with Overlapping Fields

    Code:
         A    N25                           9 68'Effective Date'              
         A     25                           9 68'Expiration Date'
    Turn *OFF indicator 25 to show 'Effective Date'. Turn it on for the other.

    Michael
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: DSPF with Overlapping input/output Fields in subfile.

      Thanks for your replay , but in my case it is not text field, it is Input/out put(B) field in subfile, plz advice me to overlap this type of entry fields in subfile .

      Thanks
      Albert

      Comment


      • #4
        Re: DSPF with Overlapping input/output Fields in subfile.

        Albert,

        You must turn the ND indicator on and then do an update to the subfile to make it work.
        I would also create a hidden field to update at the same time saying which field is displayed. THat way if you have a validate subroutine that also updates subfile with errors you can be sure to control which field is being displayed.

        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: DSPF with Overlapping input/output fields in subfile

          Yes i am following that procedure setting on ND indicator and update the subfile but it will work if two not exactely on the same position , if two fields are on the same position second value not displaying but first value getting invisible , so i am using OVRDTA in field level in subfile but in this case not compiling the DSPF giving error as have to use PUTOVR, any other solution?


          plz advice.

          Thanks
          Albert.

          Comment


          • #6
            Re: DSPF with Overlapping Fields

            Hi Albert,

            if the SFLPAG = SFLSIZ, then you can use field conditioning
            indicators. For example

            N25 EXPDATE 10A O 6 7TEXT('Expiry date')
            N25 EffDate 10A O 6 25TEXT('Effective date')

            25 STRDAT 7A O 6 7TEXT('START date')
            25 ENDDAT 10A O 6 25TEXT('END date')


            The DSPATR(ND) will not work because the field and its
            attribute byte are still on the screen even though they are not visible.
            If another field's attribute byte or data bytes happens to change the attribute
            byte of the non-display field, it will suddenly appear.
            Thanks,
            Giri

            Comment


            • #7
              Re: DSPF with Overlapping Fields

              Might have to do it programmaticly. Sounds like you have a situation where one field or another field needs to be displayed/edited but not both at the same time and rather than use up the space on the screen to show both fields, you want to only show one at a time. I've done this by using a work field that met the requirement for both fields (both text in my case) and a hidden field like Jamie suggested that kept up with which field was being displayed on the subfile record. I used a 10 alpha hidden field and just punched in the field name. Then in my edit check, if the hidden field was one value I did the edit that way and if it was the other it did the other edit. Same logic works for the update/write routines to determine which 'real' field to put the work field value into. This works only if you happen to know what field they are wanting to enter at the time you build the subfile.
              Goodbye

              Comment


              • #8
                Re: DSPF with Overlapping Fields

                Thanks for replay

                Kenm's method is suitable in my case. because Condition indicator will not work in subfile and ND too in case of I/O fields.

                Yes i had done that by using Hidden field and moving this hidden field values to a Common field which is actieve in subfile always and changing this common fields values based on condition.


                Thanks again for prompt replay

                Albert.

                Comment


                • #9
                  Re: DSPF with Overlapping Fields

                  Please can you explain this method by an example

                  Thanks for your time
                  Best Regards
                  Waleed A. G.
                  Senior Programmer

                  Comment

                  Working...
                  X