|
whew!!! <g> - Dan Bale (I am *NOT* "Dale" http://archive.midrange.com/midrange-l/200105/msg00281.html ) SAMSA, Inc. 989-790-0507 DBale@SAMSA.com <mailto:DBale@SAMSA.com> Quiquid latine dictum sit altum viditur. (Whatever is said in Latin seems profound.) -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Jim Langston Sent: Thursday, June 06, 2002 4:42 PM To: 'rpg400-l@midrange.com' Subject: RE: Resetting %EOF Dan, I have coded like this in the past, the only thing I didn't like about it was the if statement that could get extremely large if the record processing was complex. The other option is to use the leave statement, but I personally don't like to use leave or other type of break out of the loop instructions. Then again, I've been bitten by the 2 reads before, when I needed to change the read statement for some reason and only remembered to change one of the 2 and forgot about the other one. One way I handled this in the past with a complex read statement (setting up variables, etc..) was to actually put the read and supporting statement in a subroutine, and call the subroutine each time so I only had to change the read once, not elegant either. I don't think there is a truly elegant way to do this in RPG, although C has solved the problem with it's syntax: while ( read(somefile, somebuffer) != NULL ) { } which we don't seem to have (yet) in RPG. I flip flop on how I handle this now and then, and am not really happy with any method in RPG right now. Regards, Jim Langston
This mailing list archive is Copyright 1997-2026 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.