AppendText(FileName: String): ITextWriter;
FileName. Path and name of the file to be opened.
The AppendText method opens a file for writing in a text format and puts a cursor to the end of a file.
Sub UserProc;
Var
TextW: ITextWriter;
Begin
If File.Exists("c:\New_folder\1.txt") Then
TextW := File.AppendText("c:\New_folder\1.txt");
TextW.Encoding := CodePage.UTF8;
TextW.WriteDateTime(DateTime.Now);
End If;
End Sub UserProc;
After executing the example the current date and time converted into a text format are written to the end of the 1.txt file. UTF-8 encoding is used when working with file.
See also: