ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

subfile drop/fold

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

  • subfile drop/fold

    hi all,
    i set subfile drop/fold with *in10 & cf10
    when i press F10 Key it's working nicely , problem is
    i drop the records (press f10 once) & press page-down key Continuously - records automaitcally fold
    (not reached to eof) pls any idea?

    note: i use sql to fill the subfile

    thanks
    dhanuxp

  • #2
    Re: subfile drop/fold

    Sounds like your code is resetting the drop variable when you press page down.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: subfile drop/fold

      some late nite bathroom reading (mode specifically)


      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


      • #4
        Re: subfile drop/fold

        Originally posted by jamief View Post
        YEP fixed it jemief tttthanks
        but one more q to ask .. my F10 subroutine is disable why??
        i means
        Code:
         When  KEY = @F06;
           Exsr @F06sr;   
         When  KEY = @F10;
           Exsr @F10sr;
        i can add brake point to f06sr & go into it
        but f10sr ??? no answer
        actually i hope to execute another process when the f10 is press
        so how?

        thanks
        dhanuxp

        Comment


        • #5
          Re: subfile drop/fold

          Code:
           When  KEY = @F06;
             Exsr @F06sr;   
           When  KEY = @F10;
             Exsr @F10sr;
          
          i can add brake point to f06sr & go into it but f10sr ??? no answer
          actually i hope to execute another process when the f10 is press so how?
          Can't you do ?

          Code:
           When  KEY = @F06;
             Exsr @F06sr;   
           When  KEY = @F10;
             Exsr @F10sr;
             Exsr @F06sr;
          Or am I seeing double? Or is it the other way around ?

          Comment


          • #6
            Re: subfile drop/fold

            NO I only wanted to execute @F10sr but cant
            I put filelevel CF10 & define
            Code:
            D @F10            C                   CONST(X'3A')
            mm.. every things is ok but not working,, may be conflict with subfile drop/fold -- so how to overcome this

            thanks

            Comment


            • #7
              Re: subfile drop/fold

              I hope you did not forget to define a F10 in your DDS display?

              Code:
              A* Function Key F10
              A                                      CF10
              Check it, it's easy to overlook it when you debug a rpgsource !

              Comment


              • #8
                Re: subfile drop/fold

                Just a side note... it is bad practise to use @ in names. The source member does convert properly when accessed on a machine where the CCSID is different from the original.
                Regards

                Kit
                http://www.ecofitonline.com
                DeskfIT - ChangefIT - XrefIT
                ___________________________________
                There are only 3 kinds of people -
                Those that can count and those that can't.

                Comment


                • #9
                  Re: subfile drop/fold

                  Just a remark!
                  Try to avoid to start variables/fields/constants with: @ or # or $

                  Wait ! I just looked at one of my DDS source codes.

                  I have:

                  Code:
                  A  10                                  SFLDROP(CF10)   
                  A N10                                  SFLFOLD(CF10)
                  try also ( for debugging ) that *INKJ = F10 works !

                  Code:
                    
                                    WHEN      *INKJ;
                                    DSPLY     'F10 works';
                  With the *IN10 indicator you could set DROP/FOLD !

                  Comment


                  • #10
                    Re: subfile drop/fold

                    Did some research on the net an I learned this:

                    Indicator Data Structure for DSPLY

                    By default, the indicators 01 to 99 on a display or print file are mapped to the indicators 01 to 99 in an RPG program.
                    But when we use the file keyword INDDS (Indicator Data Structure), they are mapped to a data structure instead of the indicators.

                    In other words, the 99 indicators used with the display or print file are now associated with the data structure
                    instead of the indicators *IN01 to *IN99 in the program.

                    The code below shows an example of using the INDDS.

                    The indicators for the display file are mapped to the data structure DspInd.

                    DspInd is a 99 byte data structure, with each byte corresponding to one of the 99 indicators for the display file.

                    This means that for the display file, we MUST use the indicators in the data structure and NOT the numbered indicators.

                    For example, in this program, if we turned on indicator *IN31, it would have no impact on the display file.

                    The program logic must refer to the indicator Error in order to have an impact on the display file.

                    Named indicators are a lot easier to decipher!
                    Code:
                    FDisplay   CF   E             WORKSTN INDDS(DspInd) 
                         
                     D DspInd         DS                                        
                      * Response indicators              
                     D   F3Exit               3      3N                         
                     D   F12Cancel           12     12N                         
                      * Conditioning indicators  
                     D  AllErrors            31     33    
                     D   Error               31     31N                         
                     D   StDateErr           32     32N                         
                     D   EndDateErr          33     33N                         
                                                       
                            Eval      AllErrors = *Zeros;  
                                        
                            StDateErr = StartDate < Today;
                            EndDateErr = EndDate < StartDate;
                            Error = StDateErr or EndDateErr;
                    
                            ExFmt     MyScreen;  
                                              
                            If  F3Exit or F12Cancel;
                    The use of INDDS requires the use of the file level keyword INDARA in the DDS for the display/print file.

                    In most cases, changing a file to use INDARA will have no effect unless a RESET or CLEAR operation is used.

                    In this case it will now be necessary to also RESET/CLEAR the associated indicators.

                    The question is ? Did you use INDDS and if yes, was there a INDARA keyword in your DDS Dsply?

                    Comment


                    • #11
                      Re: subfile drop/fold

                      Did you use INDDS and if yes, was there a INDARA keyword in your DDS Dsply?
                      NO NOT

                      try also ( for debugging ) that *INKJ = F10 works !
                      NO

                      Code:
                      A  88                                  SFLDROP(CF10)   
                      A N88                                  SFLFOLD(CF10)
                      no result for my qry.....

                      dhanuxp

                      Comment


                      • #12
                        Re: subfile drop/fold

                        Originally posted by dhanuxp View Post
                        i can add brake point to f06sr & go into it
                        but f10sr ??? no answer
                        actually i hope to execute another process when the f10 is press
                        so how?

                        dont know if this will answer your question. but in my experience in debugging my pgms, the sfldrop/fold will not proceed to the next line of your pgm after the exfmt/write.

                        when you set a breakpoint at the exfmt/read stmt, it will display your screen. but when you press the sfldrop/fold key it will not execute the next line of your pgm. i would assume that the sfldrop/fold is still part of the EXFMT command process.

                        of course, this is just based on what i experienced. you can try to debug your program and see if it will go to the next line.


                        just wondering, why do you need to do some process during sfldrop/fold??? this is for display presentation... if you need to do some calc or something, you can do so before you even display your sfl... just a thought
                        idiot and stoopid with SQL

                        Comment


                        • #13
                          Re: subfile drop/fold

                          I agree with Eddie_B's observation in that the sfldrop / sflfold action is not seen in debug. HOWEVER the status of the indicator(s) can be seen immediately after the screen is next read.

                          Regards,
                          John McKay
                          jmckay@mckaysoftware.ie
                          http://www.rpglanguage.com

                          Comment


                          • #14
                            Re: subfile drop/fold

                            Originally posted by jmckay View Post
                            I agree with Eddie_B's observation in that the sfldrop / sflfold action is not seen in debug. HOWEVER the status of the indicator(s) can be seen immediately after the screen is next read.

                            Regards,

                            a thought just occured to me. if press the F10(sfldrop/fold) repeatedly, then press another fkey or enter key, is there a way for the program to know if the sfl is folded/dropped?
                            idiot and stoopid with SQL

                            Comment


                            • #15
                              Re: subfile drop/fold

                              The sflfold / sfldrop indicator always the current status.

                              Regards,
                              John McKay
                              jmckay@mckaysoftware.ie
                              http://www.rpglanguage.com

                              Comment

                              Working...
                              X