如题

解决方案 »

  1.   

    var   f : System.TextFile;
       i, j, Y : Integer;
     begin
       AssignFile(f,'TEST.TXT');
       Rewrite(f);
       { Create a file with 8 numbers and some
         whitespace at the ends of the lines }
       Writeln(f,'1 2 3 4 ');
       Writeln(f,'5 6 7 8 ');
       Reset(f);
       { Read the numbers back. SeekEof returns TRUE if there is no 
         more text (other than whitespace) in the file. }
       Y := 5;
       while not SeekEof(f) do
       begin
         Read(f,j);     Canvas.TextOut(5, Y, IntToStr(j));
         Y := Y + Canvas.TextHeight(IntToStr(j)) + 5;
       end; end;
      

  2.   

    var   f : System.TextFile;
       i, j, Y : Integer;
     begin
       AssignFile(f,'TEST.TXT');
       Rewrite(f);
       { Create a file with 8 numbers and some
         whitespace at the ends of the lines }
       Writeln(f,'1 2 3 4 ');
       Writeln(f,'5 6 7 8 ');
       Reset(f);
       { Read the numbers back. SeekEof returns TRUE if there is no 
         more text (other than whitespace) in the file. }
       Y := 5;
       while not SeekEof(f) do
       begin
         Read(f,j);     Canvas.TextOut(5, Y, IntToStr(j));
         Y := Y + Canvas.TextHeight(IntToStr(j)) + 5;
       end; end;