Result = WriteCharacter(#File, Character.c [, Format])
Write a character number (1 byte in ASCII, 2 bytes in unicode) to a file.


#File The file to write to.
Character The character value to write.
Format (optional) The format of the character to write. It can be one of the following value:
  #PB_Ascii  : 1 byte character.
  #PB_Unicode: 2 bytes character (default, see unicode mode).
  #PB_UTF8   : multi-bytes character (from 1 to 4 bytes).

Return value

Returns nonzero if the operation was successful or zero if it failed.


Because of file buffering, this function may return successful even if there is not enough space left on the output device for the write operation. The file must be opened using a write-capable function (i.e. not with ReadFile()).

For an example see the CreateFile() function - with WriteCharacter() only a character number is written, instead of a string.

See Also

ReadCharacter(), WriteAsciiCharacter(), WriteUnicodeCharacter(), CreateFile(), OpenFile()

Supported OS


<- WriteByte() - File Index - WriteData() ->