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



One possible gotcha to using %eof() instead of %eof(filename) is that a successful SETLL, SETGT, OPEN,
or CHAIN will set %eof(filename) = *OFF. But %eof() will be unchanged.

I always use %eof(filename).

HTH,

Charles Wilt
--
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307

wiltc@xxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of john e
Sent: Thursday, July 03, 2008 5:46 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Standards question: What is your feeling
about%found&%eofvs.%found(file) & %eof(file) ?


I don't think this is purely style, like indenting two or four spaces.
It's about a quite important principle and that is "don't repeat
yourself". Problem is, it seems to contradict with the principle of
explicit vs implicit. It's almost always better to be explicit instead of
implicit. But in this case, its better to prevail the DRY principle over
the explicit one, because actually you were explicit in mentioning the
filename in the chain/read opcode. Although in another statement. But if
that statement is the previous one then you could see the two (chain; if
%found;) simply as one in which you mention the filename only once.

Date: Wed, 2 Jul 2008 15:27:01 -0500
From: joepluta@xxxxxxxxxxxxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Standards question: What is your feeling about
%found&%eofvs.%found(file) & %eof(file) ?

Lim Hock-Chai wrote:
When I see,
Read myFile
Dow not %eof()

My mind immediately knows that you are trying to loop thru myFile
(Which
translates to clearer for me).

Okay, I understand your point, and frankly I think it's perfectly valid
- for you. This is a perfect example of why I try to stay out of
programming style arguments; it is ultimately impossible to find the One
True Style.

Unless you qualify your initial premise with "in my opinion", style
statements are very hard to defend. There are often several equally
valid ways of doing the same thing. The problem comes when you try
telling someone else that their way is "wrong". That's when you start
hearing things like "readability" and "self-definition" and
"maintainability". As nice of concepts as all those things are, they
are often mutually exclusive. This is a perfect case; even though it
can be reasnonably argued that an unqualified %eof is easier to
maintain, it fails on the pure self-definition attribute. And so if you
insist on using some external yardstick to justify your decisions - and
more importantly to try to force others to agree with you - then you
usually end up painted into a syntactical corner.

Rather than trying to tell someone else how to code, it's far more
important for you to come up with a consistent, logical set of standards
for your shop. Then take the time you would spend trying to convince
people on mailing lists and instead use it to document your standards
for the newcomers; they'll benefit more from it than someone who is
likely to never agree with anyway.

Just my .02

Joe
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


_________________________________________________________________
De leukste online filmpjes vind je op MSN Video!
http://video.msn.com/video.aspx?mkt=nl-nl
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.

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.