× 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: READE is confusing to me
  • From: "M. Lazarus" <mlazarus@xxxxxxxx>
  • Date: Thu, 14 Sep 2000 00:18:56 -0400

Dave,

At 9/13/00 09:42 AM -0400, you wrote:
>On the contrary, I think the BIFs are quite consistent.  The confusion is
>the result of our long habit of using the same indicator number for
>different functions in different op-codes.  It makes perfect sense to me
>that a CHAIN would result in a %FOUND/NOT %FOUND and a READE would result in
>a %EOF/NOT %EOF, and that these are different things.  However, after using
>*IN90 for more than 10 years in both functions, it's disconcerting to have
>to change one's thinking.  If we explicitly do what the indicators did
>implicitly, though, I think the code actually becomes more understandable.
>Consider a priming read loop done like this:
>
>      D EndLoop         S               N
>
>
>      C     Key           Chain(E)  File
>      C                   Eval      EndLoop = Not %Found(File)
>
>      C                   DoW         Not EndLoop
>
>         *  stuff
>
>      C     Key           ReadE(E)  File
>      C                   Eval      EndLoop = %EOF(File)
>
>      C                   EndDo

  I would much rather be able to do:

      C     Key           Chain     File
      C                   DoW         %Found( File )

         *  stuff

      C     Key           ReadE     File
      C                   EndDo

  Or...

      C     Key           Chain     File
      C                   DoW         NOT  %Eof( File )

         *  stuff

      C     Key           ReadE     File
      C                   EndDo

  Why would you want to have to define and populate a flag variable when 
proper %BIF behavior should do the job?

>When I first tried to use the BIFs, it annoyed me that I couldn't just
>substitute %EOF for *INxx, but it actually makes a whole lot more sense to
>me to use something like EndLoop, mapped explicitly to the contextually
>correct BIF.  What do you think?

  I think IBM has a chance to rectify a poor design feature that they were 
stuck with until now (for compatibility reasons.)  Doing it the "proper" 
way is a lot more logical than trying to mimic a long standing deficiency.

  As an aside, remember when full-procedural files came into being and you 
didn't have to worry about the status of the indicator on a READ (which was 
defined as a demand file)?  IBM came through and rectified a bug that 
"couldn't be corrected" due to all the existing code that relied on that 
behavior that would break.

  -mark

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