ReadString()

Syntax

Text$ = ReadString(#File [, Flags [, Length]])
Description
Read a string from a file until an 'End Of Line' character is found (Unix, DOS and Macintosh file formats are supported).

Parameters

#File The file to read from.
Flags (optional) The flags to apply while reading the string. It may be one of the following values:
  #PB_Ascii  : reads the string as ASCII.
  #PB_UTF8   : reads the string as UTF8 (default).
  #PB_Unicode: reads the string as UTF16.
combined with:
  #PB_File_IgnoreEOL: ignores the end of line (but the resulting string will still contain them) until the specified
                      length or the end of file.
Length (optional) Read the file until the length (in characters) have been reached. If an end of line is encountered before the length is reached, the read will stop (unless the flag #PB_File_IgnoreEOL has been set).

Return value

Returns the read string, or an empty string if the read has failed.

See Also

WriteString(), ReadStringFormat(), ReadFile()
<- ReadQuad() - File Index - ReadStringFormat() ->