{
SeekEoln example
}

{$APPTYPE CONSOLE}

procedure TForm1.Button1Click(Sender: TObject);
var
   f: System.TextFile;
   j: Integer;
   s: string;
begin
   AssignFile(f,'TEST.TXT');
   Rewrite(f);

   // Create data with white space at beginning and
   // end of line to demonstrate that SeekEoln is
   // immune to this.
   Writeln(f, '    1 2 3 4      ');
   Writeln(f, 'Some text');

   Reset(f);

   while not SeekEoln(f) do // Will skip white space
   begin
     Read(f, j);
     Writeln(j);
   end;
   Readln(f); // Read line-end marker

   Readln(f, s); // Read string with line-end marker
   Writeln(s);

   Readln;
end. 
