FT Text File Management

 FT_DFCLOSE()     Close file displayed by FT_DISPFILE()
 FT_DFSETUP()     Set up parameters for FT_DISPFILE()
 FT_DISPFILE()    Browse a text file
 FT_FAPPEND()     Appends a line to the currently selected text file
 FT_FDELETE()     Deletes a line from the currently selected text file
 FT_FEOF()        Determine when end of text file is encountered
 FT_FERROR()      Return the error code for a text file operation 
 FT_FGOBOT()      Go to the last record in a text file
 FT_FGOTO()       Move record pointer to specific record in a text file
 FT_FGOTOP()      Go to the first record in a text file
 FT_FINSERT()     Inserts a line in the currently selected text file
 FT_FLASTRE()     Get the no. of records in the currently selected text file
 FT_FREADLN()     Read a line from the currently selected text file
 FT_FRECNO()      Return the current record number of a text file
 FT_FSELECT()     Select a text file workarea
 FT_FSKIP()       Move the record pointer to a new position in a text file
 FT_FUSE()        Open or close a text file for use by the FT_F* functions
 FT_FWRITELN()    Write a line to the currently selected text file

 

FT_FUSE

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

 Syntax

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

 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 file handle.  If the file cannot be
     opened, -1 will be returned.

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

 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

     FT_FUSE( "text.c" )      // open text file
     DO WHILE !FT_FEOF()
        ? FT_FREADLN()
        FT_FSKIP()
     ENDDO
     FT_FUSE()                // close file

 Source: FTTEXT.C

 Author: Brice de Ganahl and Steve Larsen

See Also: FT_FUSE() FT_FSELECT()

FT_DFCLOSE

FT_DFCLOSE()
 Close file displayed by FT_DISPFILE()

 Syntax

      FT_DFCLOSE() -> NIL

 Arguments

     None

 Returns

     NIL

 Description

     Closes the file opened by FT_DFSETUP()

 Examples

     @ 4,9 TO 11,71

     FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
                 "AaBb" + Chr(143), .T., 5, 132, 4096)

     cKey = FT_DISPFILE()

     FT_DFCLOSE()

     @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'

 Source: DFILE.PRG

 Author: Mike Taylor

See Also: FT_DFSETUP() FT_DISPFILE()