tags:

views:

9

answers:

1
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.

+2  A: 

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

Michał Niklas