Removing a Window without Re-Displaying the Underlying Record Format

Tags:
AS/400
RPGLE

Program TST040 displays format Fm01Fmt. When the user presses F8 program TST041 is called, which displays a window and immediately returns to TST040 to continue processing (denoted by the Sleep function). After the “processing” completes, Fm01Fmt is redisplayed, removing the window from TST041. This all works as intended, but is there a way to display Fm01Fmt as it was before the window in TST041 overlaid it without having to refresh the original display (i.e. Exfmt Fm01Fmt)? In other words, is there a way to remove the TST041 window without having to run the Exfmt Fm01Fmt a second time? I don’t mind having to call TST041 a second time after the “processing” completes (after the Sleep function) to remove the window if there is a way to do so.

Another way to explain this is to imagine that the DoU *in03 = *on loop didn’t exist. Is there a way to restore what Fm01Fmt was before the call to TST041, without having to do a 2nd Exfmt Fm01Fmt?  TST040

     h Option(*SrcStmt:*NoDebugIO)                                                                  
     h DftActGrp(*no)  ActGrp(*Caller)                                                              
     h BndDir('QC2LE')                                                                              
                                                                                                    
     FTst040Fm  cf   e             Workstn                                                          
                                                                                                    
     d Tst041          pr                  ExtPgm('TST041')                                         
     d  ptxt                         35a   Const                                                    
                                                                                                    
     d Sleep           pr            10u 0 extproc('sleep')                                         
     d  interval                     10u 0 value                                                    
                                                                                                    
      /free                                                                                         
                                                                                                    
       txt02 = *All'2345678901';                                                                    
                                                                                                    
       DoU *in03 = *on;                                                                             
         Exfmt Fm01Fmt;                                                                             
         If *in03;                                                                                  
           Leave;                                                                                   
         EndIf;                                                                                     
                                                                                                    
         If *in08;                                                                                  
           Callp Tst041('Loading Some Data ...');                                                   
           Sleep(2);                                                                                
         EndIf;                                                                                     
       EndDo;                                                                                       
                                                                                                    
       *inLr = *on;                                                                                 
                                                                                                    
      /end-free

TST040FM

     A                                      DSPSIZ(24 80 *DS3)
     A                                      CF03(03 'CMD03 Exit')
     A                                      CF08(08 'CMD08 Load')
     A                                      PRINT

     A          R FM01FMT
     A                                  1  2'Name:' COLOR(WHT)
     A            NAME          20A  B  1  8
     A            TXT02       1759A     2  2
     A                                 24  2'F3=Exit' COLOR(BLU)
     A                                 24 12'F8=Load' COLOR(BLU)


TST041

     h Option(*SrcStmt:*NoDebugIO)
     h DftActGrp(*no)  ActGrp(*Caller)

     FTst041Fm  cf   e             Workstn

     d parm            pr                  Extpgm('TST041')
     d  pTxt                         35a   Const

     d parm            pi
     d  pTxt                         35a   Const

      /free

       txt = pTxt;
       Write Fm01Fmt;

       *inLr = *on;
       Return;

      /end-free


TST041FM

     A                                      DSPSIZ(24 80 *DS3)
     A                                      CF03(03 'CMD03 Exit')
     A                                      PRINT

     A          R FM01FMT
     A                                      FRCDTA
     A                                      LOCK
     A                                      KEEP
     A                                      WINDOW(*DFT 2 35 *NOMSGLIN)
     A            TXT           35      1  1COLOR(WHT)
     A                                  2 12'Please wait.'
     A                                      COLOR(WHT)

     A          R DUMMY
     A                                      ASSUME
     A                                  1  2' '       
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: