From Clomosy Docs
procedure WriteLn(var FileHandle TextFile; const Expression1 string);
`WriteLn` is used to add a line to a file. The function appends a line of text to the specified file and automatically moves to the next line.
It is observed that data is not written to the file until it is closed (using CloseFile).
Example
var
myFile: TextFile;
fileName: string;
{
fileName = 'example.txt';
// Open the file
AssignFile(myFile, fileName);
Rewrite(myFile); // Open the file in write mode
// Write a line to the file
WriteLn(myFile, 'Hello, this is a write example.');
// Close the file
CloseFile(myFile);
}