Lösung:
Delphi-Quellcode:
procedure save1
begin
pfad := extractfilepath(paramstr(0));
pfad := pfad + Edit1.Text + '.dat';
Stream := TFileStream.Create(pfad, fmCreate);
...
procedure TForm1.FileListBox1Click(Sender: TObject);
var
s:string;
i: integer;
begin
s := Filelistbox1.filename;
Edit1.text := ExtractfileName(s);
Stream := TFileStream.Create(s, fmOpenRead);
Stream.ReadBuffer(dsmax, SizeOf(Word));
for i := dsmax - 1 downto 0 do
Stream.ReadBuffer(Daten[i], SizeOf(TDaten));
dsOpen;
Stream.Free;
Stream := nil;
end;
Ereignisse:
FileListBox1:OnClick FileListBox1Click