At the moment I'm testing a new script and I often need to write and read files in order to get saved data.
I always get the content of the file + a blank line in the case I listed below. Therefore I'm worried about the Read- and WriteFile function ...
WriteFile(DatabaseFolder + 'LastBackup.txt', FormatDate('dd/mm/yy'));
// content should be a date like 21-04-08
LastBackup:= ReadFile(DatabaseFolder + 'LastBackup.txt');
// will show the date and a blank line ... confusing
WriteLn(LastBackup);
I also tried to avoid this problem:
LastBackup:= GetPiece(ReadFile(DatabaseFolder + 'LastBackup.txt'), #13#10, 0);
This solution works fine ... but I'm wondering why none has the same problem. Is there any known bug or is the blank line shalled?
Greetings
Markus