ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Auto Refresh Subfile Screen

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

  • #16
    Re: Auto Refresh Subfile Screen

    also here




    Happy Friday everyone,,,,,!!
    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


    • #17
      Re: Auto Refresh Subfile Screen

      I have try out with the INVITE & WAITRCD method, but still cannot work. I get the session error messge.

      Here is my DSPF & RPG source together with the error message, can someone help me out?
      Attached Files

      Comment


      • #18
        Re: Auto Refresh Subfile Screen

        Nope doesn't work for me either. Here's a code snippet:

        PHP Code:
        A          R SCR2CTL                   SFLCTL(SCR2SFL)                     
        A*%%TS  SD  20060523      REL-V5R3M0  5722-WDS             
        A                                      SFLSIZ
        (0999)                        
        A                                      SFLPAG(0010)                        
        A                                      HELP(25 'HELP TEXT')                
        A                                      CF03                                
        A                                      CF05                                
        A                                      CF08                                
        A                                      CF10                                
        A                                      CF11                                
        A                                      CF12                                
        A                                      CF17                                
        A                                      CF18                                
        A                                      CF01
        (25)                            
        A                                      CF24                                
        A                                      VLDCMDKEY
        (28 'Valid Command Key')   
        A                                      SETOF(50 'SFLNXTCHG')               
        A  30                                  PUTOVR                           
        A  66                                  INVITE                           
        A                                      OVERLAY                          
        A                                      BLINK                            
        A                                      OVRDTA                           
        A                                      OVRATR                           
        A  63                                  SFLDSP                           
        A  61                                  SFLDSPCTL                        
        A N61                                  SFLCLR                           
        A  91                                  SFLEND
        (*MORE)                    
        A N91                                  ROLLUP(26 'VIEW NEXT RECORD'
        RPGLe:
        PHP Code:
        C                   EXSR      CHKFKY                                           
        C                   WRITE     SFMSGC                                           
        c                   
        Eval      *In66 = *on                                      
        C                   Write     SCR2CTL                                          
        C                   Read      MyDisplayFile                             84    
        Low Indicator  
        C
        *                  EXFMT     SCR2CTL                                          
        C                   EXSR      RstInd                                           
        C                   END                                                        
         
        *                                                                             
        C                   MOVE      '0'           *IN98                              
        c                   
        If        *In84 and Stat 1331                            
        C                   Clear                   RRNLST                             
        C                   Exsr      SelSubf                                          
        c                   
        Endif 
        Display file is compiled with waitrcd (10)

        It displays the subfile control/records ok but it never resumes control after the waitrcd(10). I assume it should wait 10 secs then no responses auto refresh my subfile.

        Bill
        Bill
        "A good friend will bail you out of jail,
        A true friend would be sitting beside you saying,
        'Wow, that was fun.'"

        Comment


        • #19
          Re: Auto Refresh Subfile Screen

          Hi Bill:

          Try the following

          1. When you compile your display Set the MAXDEV to 1 and RSTDSP to *YES.
          2. In your RPG add this to your file spec maxdev(*file).
          3. As noted in your code the invite keyword is required.
          4. In your code please validate that the end statement is conditioned properly
          5. Also in your code I assume SelSubf re-loads the sub file but where does it get written?

          If this still does not work give me a yell

          Thanks
          GLS
          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

          Comment


          • #20
            Re: Auto Refresh Subfile Screen

            Thnx GLS it was:
            2. In your RPG add this to your file spec maxdev(*file).

            that did the trick. all the other were already set. Went back and set a F-key to set auto refresh on/off.

            Thnx
            Bill
            Bill
            "A good friend will bail you out of jail,
            A true friend would be sitting beside you saying,
            'Wow, that was fun.'"

            Comment


            • #21
              Re: Auto Refresh Subfile Screen

              Anyone can show me what's wrong with my source? Please.......

              Comment


              • #22
                Re: Auto Refresh Subfile Screen

                How many records are in your data file?

                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


                • #23
                  Re: Auto Refresh Subfile Screen

                  Make sure you compile the display file witrh waitrcd(not *nomax), set it to the number of seconds to refresh.

                  also add the following line to your code:
                  FDATA IF E DISK
                  FTST101FMCF E WORKSTN
                  F RRN KSFILE PROMPT11
                  -->> F KNUM 1

                  this is the RPG/400 code RPG Le would be maxdev(*File) instead of num (the 1 should be in column 65)

                  Good Luck
                  Bill
                  Bill
                  "A good friend will bail you out of jail,
                  A true friend would be sitting beside you saying,
                  'Wow, that was fun.'"

                  Comment


                  • #24
                    Re: Auto Refresh Subfile Screen

                    How many records are in your data file?
                    My data file will have not more than 30 records at one time.
                    Thanks for reply from all of you guys.

                    By the way, Billw, after i add that line still cannot work.

                    Comment


                    • #25
                      Re: Auto Refresh Subfile Screen

                      This was taken from Search 400 ask the iseries expert:



                      1. The INVITE keyword must be on the main format (the format you would normally use EXFMT to write/read in your program).

                      2. The parameter WAITRCD(n) must be specified on the CRTDSPF command. "n" is the number of seconds to wait before control is returned to the program. Also specify RSTDSP(*YES) and MAXDEV(1). You can use OVRDSPF before opening the display file to change the value of "n."

                      3. The KNUM keyword must be specified on the F-spec for the WORKSTN file in your RPG program, with a value of 1 (RPG), or MAXDEV(*FILE) (RPGLE).

                      4. Instead of EXFMT, you use WRITE to the FORMAT name, and READ from the DISPLAY FILE name. The READ should have resulting indicators specified at the Lo and Eq positions (RPG), or the E extender (RPGLE).

                      5. After the READ, check the *STATUS field from the display file information data structure (RPG) or %STATUS (RPGLE). If the value is 01331, then the WAIT time expired and control returned. If it is NOT 01331, then the user caused control to return by pressing a function key.


                      Good Luck
                      GLS
                      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                      Comment


                      • #26
                        Re: Auto Refresh Subfile Screen

                        Sorry GLS400, but i still fail to get the correct result. Can you help to correct my source please?


                        Thank you.
                        Attached Files

                        Comment


                        • #27
                          Re: Auto Refresh Subfile Screen

                          Changes made to screen and program. Just for fun TST101E is the RPGLE version

                          Best of Luck
                          GLS
                          Attached Files
                          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                          Comment


                          • #28
                            Re: Auto Refresh Subfile Screen

                            Hey try this following code, it works
                            while compiling DSPF use waitrcd(1) Maxdev(1)


                            PHP Code:
                               
                               A                                      DSPSIZ
                            (24 80 *DS3)       
                               
                            A          R REC1                      SFL                      
                                
                               A            FIELD1        10   O  4  3                         
                               A          R CTL1                      SFLCTL
                            (REC1)             
                               
                               
                            A                                      INVITE                   
                               A  30                                  SFLDSP                   
                               A                                      SFLDSPCTL                
                               A  30                                  SFLEND
                            (*MORE)            
                               
                            A                                      SFLSIZ(0012)             
                               
                            A                                      SFLPAG(0011)             
                               
                            A                                  3  3'Time'                   
                               
                            A                                      DSPATR(HI)               
                               
                            A                                  1 63DATE                     
                               A                                      EDTCDE
                            (Y)                
                               
                            A                                  2 63TIME                     
                               A                                      DSPATR
                            (HI)           
                               
                            A                                  1 63DATE                 
                               A                                      EDTCDE
                            (Y)            
                               
                            A                                  2 63TIME 
                            Code:
                            FAutorf    cf   e             Workstn Sfile(rec1:rrn) Maxdev(*file)    
                            F                                     Infds(infods)                    
                             *                                                                     
                            Drrn              s              4p 0                                  
                            DInfods           DS                                                   
                            DStatus                  11     15                                     
                             *                                                                     
                            C                   Eval      *in30 = *on                              
                            C     Reload        Tag                                                
                            C                   Exsr      Load                                     
                            C                   Write     Ctl1                                     
                            C                   Read(E)   Autorf                                   
                             *                                                                     
                            C                   If        Status = '01331'                         
                            C                   Goto      Reload                                   
                            C                   Endif                                              
                             *                                                                     
                            C                   Eval      *inlr = *on                              
                             *                                                                     
                             *                                                       
                            C     Load          Begsr                                
                            C                   Eval      rrn = rrn + 1              
                            C                   Eval      Field1 = %char(rrn)        
                            C                   Write     Rec1                       
                            C                   Endsr
                            Last edited by jamief; September 3, 2009, 11:45 AM. Reason: added code formatting

                            Comment


                            • #29
                              Re: Auto Refresh Subfile Screen

                              How do you get the READC (read changed) to work in this scenario?

                              Comment

                              Working...
                              X