Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find size of a text file
Message
De
28/02/2000 14:07:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/02/2000 10:51:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338422
Message ID:
00338597
Vues:
10
>>Is a way I can find the number of lines in a text file ?
>
>Probably just like a memofield. Use FileToStr() to get a string, then use MLINES or MemLines or whatever it is. But this may depend on _mline or whatever it is (sorry I'm not totally sure), so you could use Alines() to be sure.
>
>Alines(laA, FileToStr('mytext'))
>?alen(laA, 1)


aLines() function will chop it along the chr(13) boundaries, while it's not sure what the definition of a line may be in this case. I'd recommend to Set Memo To [whatever_value_you_like] and use MemLines(lcString) to determine the number of lines. If number of CRs is needed, occurs(chr(13), lcString) would be much faster than aLines(), unless we'd really have some use for the array aLines() will create. BTW, aLines() is limited to 65000 :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform