>It has to happen in everyone's life I guess, and today is my turn. I need to use FREAD() to read each line of a text file into a character variable. Each line in the file is a different length. How do I use FREAD() to add a variable length line to a char var, and move to the beginning of the next line in the file?
>
>Many thanks for the help!
As Nadya points out, fgets() will read an entire line, while fread() is designed will read a fixed number of bytes.
An interesting alternative to LLFF is to read the entire file with FileToStr(), and convert it to an array - one array element per line - with the function alines(). However, this is limited by the size of arrays (65,000 elements / lines, up to VFP version 8).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)