Ü  WHEN (When True Then Select)

·        The operations controlled by the WHEN operation are performed when the expression in the indicator-expression operand is true.

Example


031.00 C*_____MAIN SUBROUTINE BEGINS HERE TO HANDLE OPTIONS                   
0032.00 C*_____________________________________________________                
0033.00 C     MAIN          BEGSR                                              
0034.00 C* ------PAGE UP / PAGE DOWN HANDLING NOT NEEDED---         
0035.00 C                   READC     EXPD_SFL                                 
0036.00 C                   DOW       NOT %EOF()                               
0038.00 C                   SELECT                                             
0039.00 C                   WHEN      S_OPT='1'                                
0040.00 C                   EXSR      ENTSR                                    
0041.00 C                   EXSR      CLROPT                                   
0045.00 C                   WHEN      S_OPT='2'                                
0046.00 C                   EXSR      EDTSR                                    
0047.00 C                   EXSR      CLROPT                                   
0048.00 C                   WHEN      S_OPT='4'                                
0049.00 C                   EXSR      DLTSR                                    
0050.00 C                   WHEN      S_OPT='5'                                
0051.00 C                   DOW       *IN03=*OFF                                
0052.00 C                   EXSR      DSPSR                                    
0053.00 C                   ENDDO                                              
0054.00 C                   EXSR      CLROPT                                   
0056.00 C                   WHEN      S_OPT=' '                    
0057.00 C                   LEAVESR                                            
0058.00 C                   OTHER                                              
0059.00 C*                  EXSR      VALIDATE                                 
0060.00 C*                  SETON                                        56    
0061.00 C*                  EXSR      CLROPT                                   
0062.00 C                   SETON                                        9192  
0063.00 C                   ENDSL                                              
0064.00 C                   READC     EXPD_SFL                                  
0065.00 C                   ENDDO                                              
0066.00 C                   ENDSR      












User Comments:



Subscribe

.  


Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy