Read a line from an open file, specifying two strongly-typed arguments.
XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax View Source
ptrHandle AS IntPtr,
dwMax AS DWORD
) AS STRING
public static string FReadLine2(
- Type: IntPtr
The handle of the file to read from.
- Type: UInt32
The maximum number of characters to read per line. FReadLine2() will read until a hard carriage return (Chr(13)) is reached, end-of-file is encountered, or <dwMax> characters are read. The default value for <dwMax> is 256.
The line read. When the end-of-file is reached while attempting to read, FReadLine2() returns a NULL_STRING and FError() is set to 257.
This function is the same as FGets2(). Both functions are assumed to handle raw binary data and are not dependent upon the status of SetAnsi(). FReadText() and FRead4(), on the other hand, are dependent upon SetAnsi().
This example uses FReadLine2() to read an entire file with a maximum of 80 characters per line:
hF := FOpen2("docs.txt", FO_READ)
IF hF != F_ERROR
DO WHILE !FEOF(hF)
? FReadLine2(hF, 80)