No, in the call to OpenTextFile 8 means "append" and .f. means don't create if 
the file don't exist.

loFile = loFSO.OpenTextFile(m.filename, 8, .f.)

So:

? loFile.Line -1

gives the correct result.

Try it!

Gianni

On Fri, 28 Apr 2017 15:24:17 +0200, "Fernando D. Bozzo" <[email protected]> 
wrote:

>Gianni, you skipped something very important, the part that skip the lines
>so the Line property is updated:
>
>'Skip lines one by one Do While txsInput.AtEndOfStream <> True
>    txsInput.SkipLine ' or strTemp = txsInput.ReadLineLoop
>
>2017-04-28 15:08 GMT+02:00 Gianni Turri <[email protected]>:
>
>> loFSO = createobject("Scripting.FileSystemObject")
>>
>> loFile = loFSO.OpenTextFile(m.filename, 8, .f.)
>> ? loFile.Line -1
>>
>> This method overcome VFP memory / file size limits.
>>
>> Source:
>> http://stackoverflow.com/questions/7416553/function-to-count-number-of-lines-in-a-text-file

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to