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_FWRITELN

FT_FWRITELN()
 Write a line to the currently selected text file

 Syntax

      FT_FWRITELN( < cData >, [ < lInsert > ] ) -> NIL

 Arguments

     <cData> is a string of data to write to the file at the current
      record position.

     <lInsert> is a logical indicating whether the contents
     of the current record are to be preserved, that is, if lInsert
     evaluates to .T., the a new record is inserted at the current
     position.  The current record then is pushed down to FT_FRECNO()+1.

     If lInsert is .F. or omitted, the current record is replaced by
     cData.

 Returns

     NIL

 Description

     This function writes a line of text to the file in the currently
     selected text file workarea.  Text lines are delimited with a
     CRLF pair.  The record pointer is not moved.

     The contents of the current record are updated to reflect the new
     new line written, unless the Insert option is selected.

     Writing a null string has the effect of clearing the current line
     if in overstrike mode, else inserting a new line (same as
     FT_FINSERT()).

     A text file "record" is a line of text terminated by a CRLF pair.

 Examples

     // write a line of text to a file
     FT_FUSE( "config.sys" )
     DO WHILE UPPER( FT_FREADLN() ) != "FILES=" .AND. !F_FEOF()
        FT_FSKIP()
     ENDDO

     FT_FWRITELN( "FILES=30", FT_FEOF() )

 Source: FTTEXT.C

 Author: Brice de Ganahl and Steve Larsen

See Also: FT_FREADLN() FT_FRECNO() FT_FINSERT() FT_FDELETE()

FT_FREADLN

FT_FREADLN()
 Read a line from the currently selected text file

 Syntax

      FT_FREADLN() -> cLine

 Arguments

     None

 Returns

     A string containing the current record in a text file.

 Description

     This function returns a line of text read from the file in the
     currently selected text file workarea.  Text lines are delimited
     with a CRLF pair.  The record pointer is not moved.

     A text file "record" is a line of text terminated by a CRLF pair.

 Examples

     // display each record of a text file
     FT_FUSE( "text.c" )
     DO WHILE ! FT_FEOF()
        ? FT_FREADLN()
        FT_FSKIP()
     ENDDO

 Source: FTTEXT.C

 Author: Brice de Ganahl and Steve Larsen

See Also: FT_FUSE() FT_FWRITELN() FT_FRECNO() FT_FGOTOP()

FT_FINSERT

FT_FINSERT()
 Inserts a line in the currently selected text file

 Syntax

      FT_FINSERT( [ < nLines > ] ) -> NIL

 Arguments

     <nLines> is the number of lines that should be inserted at the
     current record position.

     If <nLines> is omitted, one record is inserted.

 Returns

     NIL

 Description

     This function inserts a line of text in the file in the currently
     selected text file workarea.  Text lines are delimited with a
     CRLF pair.  The record pointer is not moved.

     An optional parameter allows multiple insertions to take place
     with a single call to FT_FINSERT().

     A text file "record" is a line of text terminated by a CRLF pair.
     Each line inserted with this function will be empty.

 Examples

     // add a blank line of text to a file
     FT_FUSE( "test.txt" )

     FT_FINSERT()

 Source: FTTEXT.C

 Author: Brice de Ganahl and Steve Larsen

See Also: FT_FAPPEND() FT_FRECNO() FT_FDELETE() FT_FLASTRE()

FT_FDELETE

FT_FDELETE()
 Deletes a line from the currently selected text file

 Syntax

      FT_FDELETE( [ < nLines > ] ) -> NIL

 Arguments

     <nLines> is the number of lines to be eliminated, beginning with
     the current record position.

     If <nLines> is omitted, the current record is deleted only.

 Returns

     NIL

 Description

     This function deletes one or several lines of text from the file
     in the currently selected text file workarea.  Text lines are
     delimited with a CRLF pair.  The record pointer is not moved.

 Examples

     // delete the next 4 lines from a file
     FT_FUSE( "test.txt" )

     FT_FDELETE( 4 )

 Source: FTTEXT.C

 Author: Brice de Ganahl and Steve Larsen

See Also: FT_FAPPEND() FT_FRECNO() FT_FINSERT()