Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine Low Level File Record Count
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00911982
Message ID:
00911985
Vues:
16
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform