× 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: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Wed, 08 Mar 2000 13:04:08 -0800
  • Organization: Conex Global Logistics Services, Inc.

Dan, you say you have to look in the D-Specs to see how the constants
are defined, but what would you have t look at to see that the return code
is 'ExistingCust' ?  Also, that return code is a character string, which takes
up a lot for room on the stack than an integer value (packed).

Regards,

Jim Langston

"Bale, Dan" wrote:

> 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
>  ...
>
> Barbara Morris

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

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.