xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FileStr()

Reads a string from a file beginning at a specified offset.

Syntax

FileStr( <cFileName>, ;
        [<nBytes>]  , ;
        [<nStart>]  , ;
        [<lCtrl_Z>]   ) --> cString

Arguments

<cFileName>
This is a character string holding the name of the file to read from. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory.
<nBytes>
This is a numeric value specifying the number of bytes to read from the file. If omitted, the entire file is read.
<nStart>
This optional numeric parameter specifies the number of bytes to skip before reading from the file. It defaults to 0 bytes, which reads from the beginning of the file.
<lCtrl_Z>
This parameter defaults to .F. (false). When .T. (true) is passed, only the characters up to the first Ctrl-Z character (Chr(26)) are returned. This is useful for reading Chr(26) terminated DBT memo fields directly from a DBT file.

Return

The function returns a character string holding the data read from <cFileName>, or a null string in case of an error or when the end-of-file is reached.

Info

See also:FRead(), FReadStr(), StrFile()
Category: CT:DiskUtil , File functions , Low level file functions
Source:ct\strfile.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe