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


  • Subject: RE: Indicator enhancements (was Bale, Dan)
  • From: Scott Mildenberger <Smildenber@xxxxxxxxxxxx>
  • Date: Wed, 8 Mar 2000 13:07:44 -0700

Dan,

That creates a possibility of misspelling the literal.  That could create
errors that can be very difficult to find.  IMO it is much better to use the
constants.  If you spell it incorrectly the compiler will find it.

Scott Mildenberger

> -----Original Message-----
> From: Bale, Dan [SMTP:DBale@TFSA.Textron.com]
> Sent: Wednesday, March 08, 2000 1:02 PM
> To:   'RPG400-L@midrange.com'
> Subject:      RE: Indicator enhancements (was Bale, Dan)
> 
> Me, I'd just junk the defined constants and use literals in the
> expression.
> That way I don't have to bother looking up the D-specs to see how the
> constants are defined.
> 
> C              Eval     RtnCode = MyProc( MyParm )
> C              Select
> C              When     RtnCode = 'ExistingCust'
>  * Perform existing customer processing
> C              When     RtnCode = 'NewCust'
>  * Perform new customer processing
> C              When     RtnCode = 'Error'
> 
> -----Original Message-----
> From: bmorris@ca.ibm.com [mailto:bmorris@ca.ibm.com]
> Sent: Wednesday, March 08, 2000 2:12 PM
> To: RPG400-L@midrange.com
> Subject: Re: Indicator enhancements (was Bale, Dan)
> 
> >Date: Tue, 07 Mar 2000 17:07:10 -0600
> >From: Gary Guthrie <GaryGuthrie@home.com>
> >
> > I submit it might be clearer to:
> >
> >D Error        S      N  Inz( *Negative )
> >D ExistingCust S      N  Inz( *Positive )
> >D NewCust      S      N  Inz( *Off )
> >C              Eval     RtnCode = MyProc( MyParm )
> >C              Select
> >C              When     RtnCode = ExistingCust
> > * Perform existing customer processing
> >
> >C              When     RtnCode = NewCust
> > * Perform new customer processing
> >
> >C              When     RtnCode = Error
> > ...
> 
> Gary, I don't see that *NEGATIVE appears to have general
> usefulness.  Aside from that, indicators hold boolean values.
> If you want to return more than 2 different values, use a
> type that has more than 2 values, and use named constants
> for your special values, in both your procedure and its
> callers.
> 
> D Error        C         -1
> D ExistingCust C         1
> D NewCust      C         0
> 
> C              Eval     RtnCode = MyProc( MyParm )
> C              Select
> C              When     RtnCode = ExistingCust
>  * Perform existing customer processing
> C              When     RtnCode = NewCust
>  * Perform new customer processing
> C              When     RtnCode = Error
>  ...
> 
> +---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.