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



I read in blocks(say 1024)

EVAL      CHARSREAD     = read(fp: %addr(input): 1024)

C                   IF        CHARSREAD    <=  0
C                   EVAL      CURCHAR       = EOF
C                   EVAL      EOD           = *ON

etc.

Then you can scan the whole 1024 or look at each character in an array one
at a time looking for EOL etc.

Simple

John Carr
---------------------------------------------------
The potential problem here is that there may not be an end of line
character reached before your buffer is filled.  In C this creates a
buffer overflow and in RPG an array index error.  A solution to this is to
allocate memory for a dynamic array as needed.  Then you just need to be
careful that you set a limit of some kind on how much memory your program
will allocate.  Your file may be very large and not contain any end of
line characters.  You could end up eating all the memory on the system.

James Rich
james@eaerich.com



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.