I don't normally qualify the file name. Not because I'm lazy. Rather,
I think it is more readable.
Given that most %found() or %eof() is checked right after the io
operation, I think it is more readable to see
Chain (myKey) myFile;
If %found()
... Do something..
Endif
It is more eye straining for me to see
Chain (myKey) myFile;
If %found(myFile)
... Do something..
Endif
I above example, I'll have to make sure that the file name indicated in
%found does match the chain operation.
Now, if you do a chain and then did a %found after, say calling a
procedure, you should then qualify the file. But then again, this type
of coding, in of itself, is not safe.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Wednesday, July 02, 2008 12:52 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Standards question: What is your feeling about %found &
%eof vs%found(file) & %eof(file) ?
On 2-Jul-08, at 1:00 PM, rpg400-l-request@xxxxxxxxxxxx wrote:
I'm lazy, I don't qualify it unless I have to.
And one day all of the seconds you have saved will be lost thousands of
times over because of a weird programming bug that would never have
occurred if you had done it right the first time.
You only have to type it once - you need to read and modify the code
thousands of times.
Jon Paris
www.Partner400.com
www.SystemiDeveloper.com
--
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.
As an Amazon Associate we earn from qualifying purchases.