× 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: Douglas Handy <dhandy1@xxxxxxxxxxxxx>
  • Date: Thu, 14 Sep 2000 12:50:55 -0400

Mark,

>  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

And I'd much rather to:

      C     Key           Setll     File
      C                   DoW        %reade( File )

         *  stuff

      C                   EndDo

And, since I *think* we'll be able to do this someday, it makes me
care less about the other debate over the BIFs.  FWIW, the BIFs make
sense to me in terms of being consistent with the indicator usage, but
I do agree it is error-prone if you don't understand that different
opcodes set different BIFs.  We've all seen plenty of posts here where
people fell into that trap and didn't understand why.

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

That one is always my favorite example of how strict IBM has to be
about not "correcting" something.  I saw plenty of RPG II programs in
my day where the former programmer did *not* do a SETOF prior to a
demand READ.  Sooner or later, the program blew up or at least did not
get the right results.

I *never* saw a program which intentionally relied on this quirk of
demand READs.  It was always my opinion that if IBM changed how it
worked, that if programs behaved differently after being recompiled,
they would more likely be working correctly for the first time...

Kind of like changing arithmetic opcodes to EVAL and all of a sudden
finding out you were having field overflow all along but never knew
it.

Whenever I worked on someone else's code using demand files, I'd
always scan the source for READs to make sure the EOF indicator was
reset first.  Made for some fast debugging of programs.

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