From Clomosy Docs
ClomosyAdmin (talk | contribs) No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| Line 33: | Line 33: | ||
<h2> See Also </h2> | <h2> See Also </h2> | ||
* [[File_Handling | File Handling]] | * [[File_Handling | File Handling]] | ||
{{#seo:|title=WriteLn Using in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=WriteLn appends a line of text to a specified file and automatically moves to the next line. Data is written only after the file is closed.}} | {{#seo:|description=WriteLn appends a line of text to a specified file and automatically moves to the next line. Data is written only after the file is closed.}} | ||
Latest revision as of 13:54, 24 December 2024
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);
}