Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>freadline() - read in one line from a file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     freadline() - read in one line from a file
  Usage:    <string> = freadline(<handle>,[<linelen>])
  Params:   integer <handle> from a previous fopen() or fcreate()
            integer <linelen> - maximum line length to read in, if not
            specified than the default is a maximum length of 512.
  Returns:  a string filled with one line of text

 ---------------------------------- Example ---------------------------------

                 handle = fopen("test.txt")
                 do while .not. feof(handle)
                      temp = freadline(handle)
                      stdout(upper(temp))
                 enddo
                 fclose(handle)

                 * or - set maximum line length to 80

                 do while .not. feof(handle)
                      temp = freadline(handle,80)
                      stdout(upper(temp))
                 enddo

  Note:     If no chr(13) character is encountered after <linelen>
            characters have been read, than a string of <linelen>
            chars is returned. The default line length is 512 bytes.
            freadline() ignores line feed chars (chr(10)). After
            a line is read in, the file pointer will be positioned
            on the character following the line terminator (chr(13)).
            This may or may not be the start of the next line. In an
            MS DOS text file, the character after the chr(13)
            will most likely be a linefeed (chr(10)) which
            freadline() will ignore.

            The freadline() function will use the character specified
            by the _newline() function as a line terminator. See
            the documentation on _newline() for more information


See Also: frewind() fwriteline() stdout() stdin() ferror()

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