ReadCharacter()

Syntax

Result.c = ReadCharacter(#File [, Format])
Description
Read a character from a file, starting at the current file position.

Parameters

#File The file to read from.
Format (optional) The format of the character to read. It can be one of the following value:
  #PB_Ascii  : 1 byte character.
  #PB_Unicode: 2 bytes character (default in unicode mode).
  #PB_UTF8   : multi-bytes character (from 1 to 4 bytes).
If this flag isn't set, then the format for reading the character depends on the related setting at the previously used CreateFile(), OpenFile() or ReadFile() command.

Return value

Returns the read character or zero if there was an error.

Remarks

For an example of how to read from a file, see the ReadFile() function - with ReadCharacter() only a character is read, instead of a complete line (string).

See Also

WriteCharacter(), ReadAsciiCharacter(), ReadUnicodeCharacter(), OpenFile(), ReadFile(), Loc()

Supported OS

All

<- ReadByte() - File Index - ReadData() ->