runerror(102)文件未分配?

时间:2010-10-25 10:22:03

标签: pascal lazarus

begin
reset(f);
   assignfile(f, 'data.txt');
  Reset(f);
  found:= false;
  search := edit1.text ;
  repeat
  read(f, phone) ;
  read(f, cusfname);
  read(f, adress);
  found:= search = phone
  until eof(f) or found;
  if found then
  memo1.append(phone);
  memo1.append(cusfname);
  memo1.append(adress);
  closefile(f) ;
  if not found then showmessage('member not found');  

当我运行这个时,我得到runerror(102)文件未分配??????? p.s我公开地在程序中分配了变量。

1 个答案:

答案 0 :(得分:3)

首先reset(f)错误,您在下一行分配给f,因此之前未分配。