I once had to deal with a similar scenario. What I did was, I stored 
the file content into a string variable with the JCL "FileToString" 
function, then assign the string to the Text property of a TMemo that 
I finally read line by line, at the user's choice. It worked for me 
with no sweat.

Emmanuel

--- In [email protected], "darckness000" <[EMAIL PROTECTED]> 
wrote:
>
> Hi Everybody,
> 
> I'm trying to read line-feed (ASCII #10) terminated lines from a 
file 
> (think UNIX file), not the usual CRLF (ASCII #13 #10) terminated 
> lines.
> 
> What I'm doing at the moment is to `Read' 1 char at a time into a 
var 
> until I hit an LF + then display the string to the user. While this 
> works, it is sloooowwwwwwwwww when seeking to the last line in a 
> large file.
> 
> I've tried using `Read' with zero based character arrays - + while 
> this is much faster, read fills the array completely (ie: if the 
> array is [0..999], Read will read 1000 chars from the file) instead 
> of stopping at the LF in the file. As each line in the file is 
> variable in length, I am unable to allocate a static array. Dynamic 
> arrays don't work with `Read', but as I don't the length of each 
> string in the file this doesn't really matter.
> 
> When comparing speed against what I'm currently doing + using 
ReadLn 
> (ReadLn doesn't read the LF, I was just testing speed), ReadLn is 
so 
> much quicker it's unbelievable.
> 
> My question is, does anyone know of a way to read LF terminated 
lines 
> from a file with speed comparable to ReadLn?
> 
> Thanks :-)
>


Reply via email to