Can someone help me figure out what I am doing wrong. I am trying to write the contents of an object to a file using TFilestream. The following code writes without blowing up, but when reading the object back in I get a list that is not correct, it has an extra string at the top with a nonsense character.
writing...
Try
AFile := TFileStream.Create(FileName,fmCreate);
Except
MessageDlg('Blew up',mtError,[mbOk],0);
Exit;
End;
FKeyWords.SavetoStream(AFile);
AFile.Free;
reading...
Try
AFile := TFileStream.Create(FileName,fmOpenRead);
Except
MessageDlg('Blew up',mtError,[mbOk],0);
Exit;
End;
FKeyWords.LoadFromStream(AFile);
AFile.Free;
-- Rich