不是普通的 Read();而是想把文件读成一个个Char:
{不仅要读入换行符,连控制符 exp. #1,#2,#3...,也要顺利读入,存储到一个Char数组中}就像FinalData 文件查看器 那样

解决方案 »

  1.   

    read本身就是可以读入到char  array中
      

  2.   

    直接用TFileStream得了。读成什么格式都可以。
      

  3.   


    procedure TForm1.Button1Click(Sender: TObject);
    var
      fstream:Tfilestream;
      ch:     array[0..100] of char;
      i: integer;
    begin
      fstream:=Tfilestream.Create('tmp.dat',fmopenread);
      try
        i:=0;
        repeat
          fstream.Position:=0;
          fstream.Read(ch[i],sizeof(char));
          inc(i);
        until fstream.Position>=fstream.Size;
      finally
        fstream.Free;
        fstream:=nil;
      end;
    end;
      

  4.   

    错了吧?? fstream.Position:=0;要放到循环的外面?
      

  5.   

    似乎计算机里面的东西都可以表示为0和1两种状态。用二进制方式读取到BYTE数组,不知道能达到楼主的需求不?
      

  6.   

    4楼提醒的对procedure TForm1.Button1Click(Sender: TObject);
    var
      fstream:Tfilestream;
      ch:     array[0..100] of char;
      i: integer;
    begin
      fstream:=Tfilestream.Create('tmp.dat',fmopenread);
      try
        i:=0;
        fstream.Position:=0;    repeat
          fstream.Read(ch[i],sizeof(char));
          inc(i);
        until fstream.Position>=fstream.Size;
      finally
        fstream.Free;
        fstream:=nil;
      end;
    end;
      

  7.   

    read本身就是可以读入到char  array中