Hexi:
你的办法很好,谢谢!
只是在Write和Read一个TChart对象时,由于TChart是一个
对象树,故应使用:
procedure TForm1.WriteChart;
var W:TWriter;
F:TFileStream;
begin
F:=TFileStream.Create('aa.dat',fmCreate);
W:=TWriter.Create(F,4096);
W.WriteRootComponent(dbChart1);
W.Free;
F.Free;
end;
procedure TForm1.ReadChart;
var
R:TReader;
F:TFileStream;
begin
F:=TFileStream.Create('aa.dat',fmOpenRead);
R:=TReader.Create(F,4096);
R.ReadRootComponent(dbchart1);
R.Free;
F.Free;
end;