0
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) 文件未分配??????ps 我已公开分配程序中的变量。

4

1 回答 1

3

首先reset(f)是错误的,你f在下一行分配,所以之前没有分配。

于 2010-10-25T11:18:22.230 回答