WriteChar(Value: Char);
Value. The character that must be written.
The WriteChar method writes characters into a text file.
Sub UserProc;
Var
f: IFileStream;
TxtWriter: ITextWriter;
Begin
f := New FileStream.Create("c:\File.txt", FileOpenMode.Create, FileShare.Exclusive);
TxtWriter := New TextWriter.Create(f);
TxtWriter.Encoding := CodePage.UTF8;
TxtWriter.WriteChar(#169);
TxtWriter.WriteString("New Line");
TxtWriter.Flush;
Dispose f;
End Sub UserProc;
After executing the example a new text file File.txt is created. The character with the 169 (©) code, and the specified character string are written to the file. UTF-8 encoding is used when working with file.
See also: