ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Position Cursor

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

  • Position Cursor

    I have 4 records I am displaying on a screen: Header, Subfile1, Subfile2, and Footer. I am using DSPATR(PC HI) on a field in Subfile1. I turn on the indicator for the display attribute and then write/read my records:
    Code:
    Write Header
    Write Subfile1
    Write Subfile2
    Write Footer
    Read Header
    Read Subfile1
    Read Subfile2
    Read Footer
    The cursor does not get positioned at the correct field. The field that should have the cursor on it is hightlighted, but the cursor is in a field up in the header record. Is there anyway to get around this?

    Jane22

  • #2
    Re: Position Cursor

    place the opposite (N) indicator on the field in the control (header) record.


    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


    • #3
      Re: Position Cursor

      Jamie,

      That didn't work. It is still displayed on the header record. The indicator is on when I write the the header again. What could I be missing?

      Comment


      • #4
        Re: Position Cursor

        Is there a PC indicator defined for the header (control record) field?
        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: Position Cursor

          This is what I have:

          Code:
           A          R HEADER                                         
                  
           A                                      CF12(12 'Cancel & Return') 
           A                                      OVERLAY                    
           A        DPOS1         25A  B  4 27           
           A N71                                  DSPATR(PC)
          Code:
           A          R SUBFILE1                   SFL                 
           A            DOPT1          1A  B  8 10                    
           A  71                                  DSPATR(PC HI)

          Comment


          • #6
            Re: Position Cursor

            Looks like it should work to me ........

            Not sure what to suggest at this point...

            anyone else?

            Take care
            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


            • #7
              Re: Position Cursor

              It's a little hard to tell based on the limited amount of code

              It sounds like you are already running it through debug to check your indicator. If not that is the obvious first suggestion.

              I know it isn't the end result you want but what happens if you remove the conditioning indicator on the PC in your subfile and have no PC in the header? Does it put it somewhere in the subfile or still in the header? The result may give us an idea if it is the indicator or something else.

              Comment


              • #8
                Re: Position Cursor

                I removed the DSPATR from the header field and removed the indicator on the DSPATR on the subfile field.

                The subfile fields are hightlighted, but the cursor is still in the header record.

                Jane22

                Comment


                • #9
                  Re: Position Cursor

                  jane its going there cause its the first input and/or input output field on your display.
                  we have to turn off the PC on that field so that it will allow the cursor to be placed on
                  the subfile. In a normal subfile case this is no problem cause we can use the exfmt....
                  but because yours is a duel subfile and you are using the read/write method ..."some thing" is causing you a problem. To prove this I would do the opposite make the fields on your header be output only and test the position to on your subfile...Im betting the positioning will work.

                  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


                  • #10
                    Re: Position Cursor

                    I made the header fields output only. The cursor still does not go to the field that is highlighted. It goes to the first field in the subfile.

                    Comment

                    Working...
                    X