2010-10-25 26 views
0
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)文件未分配???????我已经在程序中公开分配了变量。runerror(102)文件未分配?

回答

3

第一个reset(f)是错的,你在下一行分配到f,所以它没有被分配过。