>I use FGETS() to retrieve the line.
>How can i get one line at a time?
>If i use nBytes it might be one or two line that it gives me.
>
>Nick,
* start with an empty buffer
lcBuff=""
do whille !feof(lnHandle)
* get one buffer full and add to last buffer's remainder
lcBuff=lcBuff+fread(lnHandle, 2048) && use your cluster size or any value you find useful
do while occurs(chr(13), lcBuff)>0
* extract one line at a time
lcOneLine=mline(lcBuff, 1)
* maybe it should be _mline+1, or _mline+2 depending on the line delimiter of your source file
* _mline is system vairable, see in Help
lcBuff=subs(lcBuff, _mline)
Do WhatEver with lcOneLine
endd
endd
* do something with the last line though it's probably empty
Do WhatEver with lcOneLine
I use this approach a lot when doing things like that - speeds things up considerably, because it reads just plain bytes, not having to analyse for line terminators. Actually, FGets internally works something like this, but its engine is obsolete and it doesn't recognize lines longer than 254.