# FREADSTR()

Reads a string from a file.

Syntax

  FREADSTR(<nHandle>, <nBytes>) --> cString

Arguments

  <nHandle> DOS file handle number.
  <nBytes> Number of bytes to read.

Returns

  <cString> an characted expression

Description

  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.

Examples

          IF ( nH := FOPEN("x.txt") ) > 0
             cStr := Freadstr(nH,100)
             ? cStr
          ENDIF
          FCLOSE(nH)

Status

  Ready

Compliance

  This function is not CA-Clipper compliant since may read strings greather the 65K depending of platform.

Files

  Library is rtl

See Also

- BIN2I()
- BIN2L()
- BIN2W()
- FERROR()
- FREAD()
- FSEEK()