本文介绍了未分配runerror(102)文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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我已经在程序中公开分配了变量.

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

推荐答案

第一个reset(f)是错误的,您在下一行中分配了f,因此之前没有分配.

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

这篇关于未分配runerror(102)文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 10:13