× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You can use *ON and *OFF instead of *ALL'0' and *ALL'1' respectivly. The
compiler expands those constants to the full length of the field. I use it
like this;
D displayInd      DS                                         
D  fKeys                        26A                          
D    exit                         N   OverLay(fkeys : 3)     
D    refresh                      N   OverLay(fkeys : 5)     
D    cancel                       N   OverLay(fkeys : 12)    
D  recordAtr                    13A                          
D   screenChanged...                                         
D                                 N   Overlay(recordAtr : 1) 
D   sflDsp                        N   OverLay(recordAtr : 4) 
D   sflDspCtl                     N   OverLay(recordAtr : 5) 
D   sflEnd                        N   OverLay(recordAtr : 6) 
D   msgSflEnd                     N   OverLay(recordAtr : 7) 
D   sflNxtChg                     N   OverLay(recordAtr : 12)
D  editError                    40A                          
D   fieldError                    N   Overlay(editError : 1) 
D                                     Dim(40)                
D  fieldAtr                     10A                          
D   protectFields...                                         
D                                 N   OverLay(fieldAtr : 1)  
D   historyColor                  N   Overlay(fieldAtr : 2)  
D  fileAtr                      10A                          

...
editError = *OFF; 

...
If Not screenChanged and   
  editError = *OFF and     
  fKeys = *OFF;            
...

Duane Christen
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Peter Dow (ML)
Sent: Wednesday, November 08, 2006 12:46 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Checking indicators


Hi Douglas,

As long as the indicators are consecutive you can use the following method:

d ptrInd          s               *   inz(%addr(*in20))
d Ind21_40        s             20a   based(ptrInd)    
 /free                                                 
      if Ind21_40 = *all'0';                           
           dsply 'All OFF';                            
      elseif Ind21_40 = *all'1';                       
           dsply 'All ON';                             
      else;                                            
           dsply 'Mixed values';                       
      endif;                                           
      *inlr = *on;                                     
 /end-free                                             

*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /

Douglas Palme wrote:
I have a need to check whether 20 indicators are on or off and I'd like to
find a way if possible to check them all without having to use multiple if
statements.

 

Is this possible?

 

 




****************************************************************************
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.

****************************************************************************
  


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.