使用类型文件
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;
这样就读出了一条记录。
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;
这样就读出了一条记录。
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