Reads a string from a file opened with low-level access
FREADSTR(<nHandle>, <nBytes>) --> cString
<nHandle> DOS file handle number.
<nBytes> Number of bytes to read.
<cString> an character expression
This function returns a character string of <nBytes> bytes from a file whose DOS file handle is <nHandle>.
The value of the file handle <nHandle> is obtained from either the FOPEN() or FCREATE() functions.
The value of <nBytes> is the number of bytes to read from the file. The returned string will be the number of characters specified in <nBytes> or the number of bytes read before an end-of-file charac- ter (ASCII 26) is found.
NOTE This function is similar to the FREAD() function, except that it will not read binary characters that may he required as part of a header of a file construct. Characters Such as CHR(0) and CHR(26) may keep this function from performing its intended operation. In this event, the FREAD() function should he used in place of the FREADSTR() function.
#include "fileio.ch" IF ( nH := FOpen( "x.txt" ) ) != F_ERROR cStr := FReadStr( nH, 100 ) ? cStr FClose( nH ) ENDIF
Library is rtl