I am designing a program that writes to and stores data in a text file. The problem is that whenever I enter new data into the file, the old data is cleared and just that one entry (line) is there. I was originally saying Rewrite(tFile) every time but now use a boolean to check if the text file has been rewritten. I still get the same problem..
begin
AssignFile(tNotifications, 'Notifications.txt');
if bRewritten = False then
begin
Rewrite(tNotifications);
bRewritten := True;
end;
Writeln('test');
CloseFile(tNotifications);