Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading plaintext?
Message
De
22/11/2008 09:42:36
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Divers
Thread ID:
01363610
Message ID:
01363648
Vues:
13
>>I was asked for help with a toy project - read in a plaintext file and return a random line from the file. I could do this easily with a table, but don't know enough about low level file functions to do that job easily. Can I get a kick in the right direction, please?
>
>Hi Chris,
>
>If the file has less than 65000 record (VFP array limit befor VFP9), you can use FILETOSTR() and ALINES(). Otherwise you'll have to use FOPEN(), FGET() and FCLOSE().

What constitutes a line? Is this from the start of a sentence? Or is it when a CRLF is encountered? You can use FILETOSTR() as suggested by Sergey and then use STREXTRACT() to parse the contents based on a line definition. You could parse into an array or into a table memo field. ALINES() also has capability to parse, but it is limited in array size for VFP8 and prior.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform