Subj : long lines in a file
To   : All
From : Michael Preslar
Date : Thu Dec 15 2005 04:15 pm

Ive recently learned of a small, well, snafu with pascal..

Some example code:

var tf:text;
    s:string;

begin
 assign(tf,'main.ans');
 reset(tf);
 while not eof(tf) do
 begin
   readln(tf,s);
   ansi_write_line(s);
 end;
 close(tf);
end.

Now heres the snafu.. Say the first line in the file has 418 characters. For
that matter, it could be any length as long as its greater than 255 chars.
Pascal will read the first 255 chars, do the ansi_write_line and then move to
the second line in the file, instead of reading the rest of the characters on
the first line before moving on.

So the question is:

What would you guys suggest as the best way to handle such situations?
blockread() then parse 255 characters at a time?
--- SBBSecho 2.11-Win32
* Origin: mount_z.synchro.net - Home of Lord/* (1:275/112)