Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine Low Level File Record Count
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00911982
Message ID:
00911985
Views:
17
Kevin,

In case of fixed len records
lcRecLen = nnn
iHand = FOPEN("c:\myfile.txt")
* Get File Size
lnFileSize = FSEEK(iHand, 0, 2)
* Get the # of recorda. 
*   Add 2 bytes to the record length 
*      for the end of the line (CHR(13) + CHR(10)) characters
lnRecCounr = lnFileSize / (lcRecLen + 2)
* Reset pointer back to the beginning of the file
= FSEEK(iHand, 0, 0)
* Continue processing
...
>Anyone have a better idea than this:
>
>
>iHand = FOPEN("c:\myfile.txt")
>
>DO WHILE NOT FEOF(iHand)
>  sTemp = FGETS(iHand)
>  iRetVal = iRetVal + 1
>ENDDO
>			
>=FCLOSE(iHand)
>
>
>If possible, I like preserve the current point position
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform