exception on Rewrite(DataFile)
Posted on 2004-03-30
My application refuses to do a rewrite(datafile) in...
procedure TNotePool.Save(FileName : string);
DataFile : TextFile;
i : integer;
...when the datafile is not new.
The datafile is created by the same application. In a previous version (working correctly), probably compiled using Delphi 4 or 5, decimal instead of hexadecimal field and line separators were used. In the new version all decimal characters have been exchanged for hexadecimal. This somehow may explain why a datafile created by the older version application/delphi has lines like these...:
...where in the later version (I use Delphi 7) they read like this...:
The new application determines which kind of datafile is to be read and continues loading the file with no errors.
Now I strongly suspect that the unwillingness of the new application to Rewrite(DataFile) has to do with this. It happens not only when an old datafile is (attempted to be) saved, but also a new one.