From Clomosy Docs
procedure Append(var FileHandle TextFile);
The `Append` procedure is used to add data to a file.
Use Write or WriteLn to write to the file after this Insert is executed.
Before using Append you should use AssignFile to assign a file to FileHandle.
While the `ReWrite` procedure erases the data in the created file and writes new data over it, the `Append` procedure does not delete the file content and continues to add data to the end of the file.
Example
var
myFile : TextFile;
{
// Try to open the Test.txt file for writing to
AssignFile(myFile, Clomosy.AppFilesPath+'Test.txt');
ReWrite(myFile);
ShowMessage('The file is added to the directory where the exe is located.');
// Write a couple of well known words to this file
WriteLn(myFile, 'Hello');
WriteLn(myFile, 'World');
ShowMessage('Lines have been added to the file.');
// Close the file
CloseFile(myFile);
// Reopen to append a final line to the file
Append(myFile);
// Write this final line
WriteLn(myFile, 'Final line added');
// Close the file for the last time
CloseFile(myFile);
}
Output:
After the file has been saved, it appears as follows.