使用类型文件
TPersonRec = record
  FirstName:String[20];
  LastName:String[20];
  Age:Integer;
end;var
  Person: TPersonRec;
  DataFile:File of TPersonRec;
begin
  AssginFile(DataFile,'Personfile.dat');
  Reset(DataFile);
  try
    if not Eof(DataFile) then
       read(DataFile,Person);
  finally
    CloseFile(DataFile);
  end;
end;
这样就读出了一条记录。

解决方案 »

  1.   

    假如TXT里,放着字段与字段值,字段与字段用“,”号分开,字段值与字段值也用“,”号分开
      

  2.   

    格式与TABLE类似    帮up者照样给分
      

  3.   

    to arewzsdone:请把问题叙述清楚,不要给wzsswz分数
    to wzsswz:另外警告你不要再次回复//倒份嫌疑//因为你们的注册名都有“wzs”
    http://www.csdn.net/Expert/TopicView1.asp?id=778352
    http://www.csdn.net/Expert/TopicView1.asp?id=786648
    http://www.csdn.net/Expert/TopicView1.asp?id=786651