代码如下:
var
    fF : Textfile;
    wF : string;
begin
  webF:=‘E:/aa.txt’;
  AssignFile(fF,wF);
  Reset(fF);
  closefile(fF);
end;在 Reset(fF)那行提示出错:Incompatible types: 'TObject' and 'Text'
百思不得其解,有人能告诉我是哪里出问题了吗?
PS:E:/aa.txt文件是存在的

解决方案 »

  1.   

    webf:='e:/aa.txt'; -> wf := 'e:\aa.txt';
      

  2.   

    var
        fF : Textfile;
        wF : string;
    begin
      wF:='E:\aa.txt';
      AssignFile(fF,wF);
      Reset(fF);
      closefile(fF);
    end;
      

  3.   

    var
        fF : Textfile;
        wF : string;
    begin
      wF:='E:\aa.txt;---------这里改动了一下(webF->wf,e:/aa.txt->e:\aa.txt)
      AssignFile(fF,wF);
      Reset(fF);
      closefile(fF);
    end;
      

  4.   

    真是不好意思,我之前的内容弄错了,我的程序里写的是var
        fF : Textfile;
        wF : string;
    begin
      wF:='E:\aa.txt';
      AssignFile(fF,wF);
      Reset(fF);
      closefile(fF);
    end;在 Reset(fF)那行提示出错:Incompatible types: 'TObject' and 'Text'感谢楼上三位,谢谢,能否再帮我看看这个是什么问题?
    其实这段代码我在其他程序上执行是通过的,不知道为什么移植过另一个程序就不行了
      

  5.   

    估计是他(或者他uses的文件中)定义了一个类, 类名也叫Textfile