× 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: How to create my own built-in functions
  • From: "James W. Kilgore" <qappdsn@xxxxxxxxxxxxx>
  • Date: Mon, 17 Jul 2000 17:30:49 -0700
  • Organization: Progressive Data Systems, Inc.

Scott,

Just a question, not a critique ....

IBM uses return values and return reasons.  How much different code would be
required for a boolean return value and of not x,  investigate the reason code?

My purpose in asking is that I am working on some procedures that will result in
a return code (0/1 no/yes not/successful fail/pass) that I want to have the
boolean response evoke the process of a 4 char reason code that just
coincidentally becomes the 4 digits of the message identifier to display to the
user.

IMHO, a boolean response is a simple branch.  One value, one if/or.  I 
understand
your test IFLE/ELSE is a single test, but you've embedded reason within 
response.
It appears that you've applied dual usage to a single value.

Is there some restriction that you are operating under that prevents dual
feedback?


Scott Klement wrote:

> I personally like to use integers as return codes.   Sure, if your goal is
> specifically to return a boolean value, an indicator would be better.
> For example something like IsDataValid()  would be better returning a
> boolean value...
>
> But with an integer you can return a lot of different things.  Lets say
> for example, you're doing a  "RtvOrder()"  subprocedure.   You might have
> a return value of "1" to mean it found the order, "0" that it couldn't
> find the order (Which isnt necessarily an error) or "-1" to indicate that
> that there was some sort of error.  (file not found, file damaged, etc)

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