Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> freadline() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    FREADLINE()

Purpose:     Read a line from a text file opened with FOPEN() or FCREATE()

Syntax:      FREADLINE( fhandle )

Arguments:   fhandle     - The numeric file handled returned by a previous
                           call to FOPEN() or FCREATE().

Returns:     The next sequential line read from the indicated file handle.

Description: FREADLINE() is a low level file I/O function (written in
             Clipper) to read a single carriage return/line feed delimited
             line from a text file.

Notes:       Assumes the file to be read has already been opened with the
             FOPEN() or FCREATE() function.  If the file handle argument
             is omitted or a non-numeric value is supplied, FREADLINE()
             will return a null and set RLIBERROR().

             FREADLINE() will read lines up to 512 characters long.  This
             line width is sufficient for most text files.  If files with
             lines longer than 512 characters are to be accessed,
             FREADLINE() may be modified by increasing the value from 512
             on the following lines:

             rl_bufffer = SPACE(512)
             rl_sizread = FREAD( p_handle, @rl_buffer, 512 )

             Unlike some other FREADLINE functions, this one does not
             return the carriage return/line feed pair (CR/LF) in the line
             which is the desired behavior.  Who needs it anyway!

Example:     *-- read AUTOEXEC.BAT and look for a SET CLIPPER= statement
             handle = FOPEN("c:\autoexec.bat")
             DO WHILE .NOT.  FEOF(handle)
                line = FREADLINE(handle)
                IF "SET CLIPPER=" $ UPPER(line)
                   *-- do whatever...
                ENDIF
             ENDDO
             FCLOSE(handle)          && remember to close the file!

Source:      RL_FREAD.PRG

See also:    FEOF()

See Also: FEOF()

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