runerror(102) file not assigned?

倾然丶 夕夏残阳落幕 提交于 2020-01-17 01:56:06

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/4013629/runerror102-file-not-assigned

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!