Hi,
nach längerer Zeit melde ich mich mal wieder mit einem Problem
Und zwar speichere ich diesen record
Delphi-Quelltext
1: 2: 3: 4: 5:
| TStatistics = record Values : Double; Series : array [0..3] of TChartSeries; procedure Clear; end; |
wie folgt ab :
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| var StatsFile : File of TStatistics; [...] try AssignFile(StatsFile, ExtractFilePath(ParamStr(0)) + '\Stats' + IntToStr(Nr) + '.dat'); ReWrite(StatsFile); Write(StatsFile, Statistics[Nr]); finally CloseFile(StatsFile); end; |
und lade ihn dann später so :
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| var StatsFile : File of TStatistics; begin try AssignFile(StatsFile, FilePath); Reset(StatsFile); Read(StatsFile, Stats); finally CloseFile(StatsFile); end; end; |
Das klappt auch, wenn ich das Programm starte, speichere und wieder lade.
Starte ich das Programm jedoch neu, kriege ich eine access violation.
Habe schon länger gesucht, aber nichts gefunden.
Kann mir jemand weiterhelfen?
Vielen Dank!
