Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dffopen()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfFOpen()
Opens a text file
------------------------------------------------------------------------------
Syntax:

     dfFOpen( <cFile>, [<nMode>],;
              [<cSep>], [<nRecLen>],;
              [<lskipRem>] ) --> nHandle

Parameters:

     <cFile>    File name.
     <nMode>    Opening mode. This is the standard Clipper opening mode, as
     defined in "Fileio.ch". The default is
     FO_READ+FO_EXCLUSIVE
     <cSep>     Line separator characters. The default are CHR(13)+CHR(10).
     <nRecLen>  Maximal record lenght. The default value is 2000 chars.
     <lSkipRem> Skip empty lines and lines beginning with ';'. The default
     value for this flag is .F.

Returns:

     <nHandle> File handle. If it is equal to -1, an error has occurred
     while opening the file.

Description:

     Opens a text file, specifying the line terminator characters, for
     being later used in  scanning its contents. It also creates a stack in
     which the file handles are stored, so that the file can be accessed
     even without knowing its handle.

Example:

     . Example 1
     
     #include "dfStd.ch"
     
     LOCAL nHandle := FCREATE( "CONFIG.NEW" )
     
     dfFOpen( "C:\CONFIG.SYS" )
     WHILE !dfFEof()
        ? dfFread()
        FWRITE( nHandle, dfFRead() +CRLF )
        dfFSkip()
     END
     dfFClose()
     
     fClose(nHandle)
     
     . Example 2
     
     #include "FILEIO.CH"
     dfFOpen( "Menu.log", FO_READ+FO_WRITE )
     IF !dfFLocate("[Error]")
        ? "No errors"
     ENDIF

See also:

     dfFClose(), dfFRead(), dfFSkip()

See Also: dfFClose() dfFRead() dfFSkip()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson