开发者

runerror(102) file not assigned?

开发者 https://www.devze.com 2023-01-21 15:34 出处:网络
begin reset(f); 开发者_如何学编程assignfile(f, \'data.txt\'); Reset(f); found:= false; search := edit1.text ;
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

精彩评论

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