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



OK, I'm doing C these days and haven't done free-form RPG. Is CHAIN gone? Why the SETLL-READE combination, when CHAIN is equivalent?

Key chain file
Dow not %eof
   ...do whatever
Key reade file
Enddo

This, however it is writeen, seems close to the 'C' version

while ((fscanf(outfile, "%c", &c))!=EOF)
{
   do stuff...
}

because it does the read before entering the loop, tests for success, whereupon the loop is entered or not. It looks like one read structurally but it's not.

Anyway, let's replace all DO, WHILE, and UNTILs in C with FORs and see how much fun we can have - an obfuscation contest is in order.

BTW, did I mention enough cross-language stuff to keep this out of the RPG list? ;-)

Vern

At 10:41 AM 11/21/2003 -0600, you wrote:
In this case, you've removed a read, but complicated the code with multiple
exit conditions. In this code:

Key setll file
Key Reade file
Dow not %eof
...process record...
Key reade file
Enddo

There is an additional read, but only one exit condition (and exit condition
check). The loop is executed 0 or more times.

In your example, you must code two exit conditions because of the DOU. The
code is executed 1 or more times.

Like Jon said, a priming read determines if there is any data in the file to
process. With DOW, we know immediately whether we should continue processing
the file. With the DOU, we don't know if there's data to process until we're
in the loop; hence, two exit conditions.

Loyd Goodbar



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.