× 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.



Michael_Schutte@xxxxxxxxxxxx wrote:
> 
> I was once taught, in either VB or ASP.NET that True equals to -1, anything
> else besides -1 is false.  So I'd imagine, that this is the same for RPG.
> 1 equates to true.  Anything returned from the procedure is false.
> 
> I tested returning '2' from an indicator prototype and it returned that the
> prototype isn't true, as it should.
> 

What you describe is similar for C: 0 is false, anything else is true.

But it's not the same for RPG.  When an indicator has a value other than
'1' or '0', the behaviour is undefined.  It might be "true" or "false"
or neither or both, depending how you test it.

If you run the following program, it displays:

DSPLY  1: False  
DSPLY  2: True   
DSPLY  3: False  
DSPLY  4: True   
DSPLY  5: True   
DSPLY  5: False  
DSPLY  6: False  
DSPLY  7: False  

I can't remember how to get it to be neither true or false; maybe
something changed so that it's not possible any more.

C                   move      '2'           fld               1
C                   move      fld           *in10              
C     *IN10         ifeq      *ON                              
C     '1: True'     dsply                                      
C                   else                                       
C     '1: False'    dsply                                      
C                   endif                                      
C     *IN10         ifeq      *OFF                             
C     '2: False'    dsply                                      
C                   else                                       
C     '2: True'     dsply                                      
C                   endif                                      
C     *IN10         ifne      *ON                              
C     '3: False'    dsply                                      
C                   else                                       
C     '3: True'     dsply                                      
C                   endif              
C     *IN10         ifne      *OFF     
C     '4: True'     dsply              
C                   else               
C     '4: False'    dsply              
C                   endif              
C   10'5: True'     dsply              
C  N10'5: False'    dsply              
C                   if        *IN10    
C     '6: True'     dsply              
C                   else               
C     '6: False'    dsply              
C                   endif              
C                   if        NOT *IN10
C     '7: False'    dsply              
C                   else               
C     '7: True'     dsply                                           
C                   endif                                           
C                   seton                                        LR


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.