开发者

runerror(102) file not assigned?

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');  

When I run this I get runerror(102) file not assigned??????? p.s I have assigned the variables in the procedure publically.


First reset(f) is wrong, you assign to f in next line, so it is not assigned before.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜