On 2017-04-21 11:27, Gianni Turri wrote:
On Fri, 21 Apr 2017 17:02:23 +0200, Gianni Turri giannit62@gmail.com wrote:
On Fri, 21 Apr 2017 10:44:34 -0400, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
VF9SP2
Currently, I'm simply doing this for now:
RowCount = OCCURS(CHR(13),FILETOSTR(m.Filename))
Is there a better (read: FASTER) way? These are tab delimited text files so I can't really use FSEEK or FSIZE(m.Filename) (which requires SET COMPATIBLE ON) because I can't be sure of each record's length.
Hi Mike,
I have never used fsize this way, I always use fseek to calculate files size.
m.handle = fopen(m.Filename, 0) m.size = fseek(m.handle, 0, 2) fclose(m.handle)
To answer your question, try this:
create cursor TMP_CURSOR (DUMMY Character (1))
append from (m.Filename) sdf
m.RowCount = reccount() +1
USE in TMP_CURSOR
? m.RowCount
May be you must use only reccount() instead of reccount() +1.
Ok now I get your approach. Cool trick. I tried it. In testing, it actually wasn't any faster than the OCCURS approach. But thanks for the response though!