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



On Tue, 1 Feb 2005, Tony Carolla wrote:

DoW readmyfile();
EndDo;

So each file would have it's own subprocedure for reading? Beautiful. Bulky, but beautiful. And if you wanted to read into a DS, then would you define the DS in the subproc and the main, and return the DS? Or would you forego encapsulation and access the Global DS? And then, while maintaining this code, you might find yourself scrolling all the way down to the bottom/back to the top,etc.

In my opinion, this overcomplicates the operation.

That's why an earlier post mentioned that it would be nice to be able to pass a handle (a pointer to an open file) and use that for the read. Then one subprocedure could read any file. Psuedo-code follows:


eval filehandle = %open(myfile);

dow (readfile(filehandle) <> %EOF)
...

P readfile    B
D readfile    PR
D filepointer          *
C            read   filepointer
      return %EOF;
P readfile    E

This could read any file at all. This is essentially the way C works. The I/O functions in C take a pointer to a file as an argument, enabling them to read a file without knowing the file name.

There's no reason why a read implemented this way couldn't put the results into a DS or even from a DS. Having a %read that worked this way would not take anything from the way read works now.

James Rich

It's not the software that's free; it's you.
        - billyskank on Groklaw

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.