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>flinecount() - count how many lines of text are in a file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     flinecount() - count how many lines of text are in a file
  Usage:    <integer> = flinecount(<handle>)
  Params:   integer <handle> from a previous fopen() or fcreate()
  Returns:  integer  equal to the number of lines in the file.

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

                 handle = fopen("data.txt")
                 numlines = flinecount(handle)
                 if (numlines < 1 .or. numlines > 4000)
                      return(0)
                 endif
                 public linearray[numlines]
                 for xx = 1 to numlines
                      linearray[xx] = freadline(handle)
                 next

  Note:     Clipper source code is provided as an example on how
            to use flocate(). See the file c_flinec.prg
            The flinecount() function will use the char specified
            by the _newline() function as a line terminator. See
            the documentation on _newline() for more information


See Also: flocate() freadline() fstrcount() ferror() _newline()

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