FT_FUSE()
Open or close a text file for use by the FT_F* functions
──────────────────────────────────────────────────────────────────────────────

Syntax


FT_FUSE( [ <cFile> ] [, <nMode> ] ) -> nHandle | 0

Arguments


<cFile> is the text file you want to open. If not specified,
the file currently open, if any, will be closed.

<nMode> is the open mode for the file. Please refer to the
discussion of open modes under FOPEN() in the Clipper manual
and FILEIO.CH for a list of allowable open modes. If not
specified, the file will be opened with a mode of
FO_READ + FO_SHARED (64).

Returns


If <cFile> is passed and the file is opened successfully, an
integer containing the text file's workarea. If the file cannot be
opened, -1 will be returned. In this case, check the return value
of ft_fError() for the cause of the error.

If FT_FUSE() is called without any arguments, it will close the
text file in the current "text area" and return 0.

If a read error occurs ft_fError() will contain the error code.

Description


The FT_F*() file functions are for reading text files, that is,
files where each line (record) is delimited by a CRLF pair.

Each file is opened in its own "workarea", similar to the concept
use by dbf files. As provided, a maximum of 10 files (in 10
workareas) can be opened (assuming there are sufficient file
handles available). That number may be increased by modifying
the #define TEXT_WORKAREAS in the C source code and recompiling.

Examples


#include "fileio.ch"

// open a text file for reading
ft_fUse( "text.txt" )

// open a text file for reading and writing
ft_fUse( "text.txt", FO_READWRITE + FO_SHARED )

// close file
ft_fUse()


Source: FTTEXT.C

Author: Brice de Ganahl and Steve Larsen