From Clomosy Docs

No edit summary
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

`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.

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);
}

See Also