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



That's why I tend to wrap the READ/READE opcode in a procedure...

/free
setll (fld1:fld2) MyFile;
dow ReadMyFile(myFileFieldDS);
//do stuff
enddo;

/end-free

Charles

On Tue, Sep 2, 2008 at 2:09 PM, Lim Hock-Chai
<Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote:
You sort of already have that.

FMYFILE IF E K DISK INFDS(infdsMyFile)

D infdsMyFile DS qualified
D status *STATUS

D FOUND C const(0)

/free
setll (myKey) myFile;
reade (myKey) myFile;
dow infdsMyFile.status = FOUND;
do stuff...
reade (myKey) myFile;
enddo
/end-free


The reason I ask for bif is because opcode cannot return a value. So,
if bif were existed, the above code would look like below:

FMYFILE IF E K DISK

D FOUND C const(0)

/free

%setll(myKey :myFile);
dow %reade(myKey :myFile) = FOUND; //no double reade needed
do stuff...
Enddo

/end-free



"Carel Teijgeler" <coteijgeler@xxxxxxxxx> wrote in message
news:<mailman.7902.1220376397.2545.rpg400-l@xxxxxxxxxxxx>...
Why should every opcode be BIFFed?

%eof and %found are not BIFs, they are indicators with the naming
comvention of a BIF.

I would prefer the eof/found status of a record was part of the INFDS,
which mean an INFDS for each file required. With TEMPLATE, LIKEDS and
QUALIFIED it is easier to have DSes with the same subfield structure.
The
indicators %eof/%found can then be made obsolete.

With regards, Carel Teijgeler

*********** REPLY SEPARATOR ***********

On 2-9-2008 at 11:13 Lim Hock-Chai wrote:

Barbara,
For the sake of getting us out of all these misery, can't you just
create
some new bifs like %chain, %read, %reade... that return %status
as return code? :).

<vhamberg@xxxxxxxxxxx> wrote in message

Thanks - that is the other form of the READx loop - I guess I don't
care
for it, as you have 2 comparisons for every time through instead of
1 - I think!! Might get optimized away in any case, but we don't know
that.



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

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.