将记录类型里面的值,保存为文件,请问如保实现。谢谢

解决方案 »

  1.   

    type  PhoneEntry = record
        FirstName, LastName: string[20];
        PhoneNumber: string[15];
        Listed: Boolean;
      end;
    var List1: file of PhoneEntry;
      

  2.   

    创建一个stringlist把数据读出来,然后调用stringlist.savetofile 方法
      

  3.   

    type 
       {定义记录}
       MyRecord=record
        Name:string[20];
        Tel:string[20];
        Birthday:tdate;
       end;
    ...
    ...
    {事件中}
    var 
       MyFile:file of MyRecord; //文件
    begin
       if not fileexists('001.dat')... //如果不存在文件001.dat,创建。否则打开
       reset(MyFile); //重新整理,准备写入数据/读出数据
       ...end;
      

  4.   

    搞来的搞去还是用了TSTRINGLIST,