Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low Level File Blues
Message
De
16/08/2000 13:42:11
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00405598
Message ID:
00405646
Vues:
17
>I am doing some fixing of Credit Card Postings in a pcc file. Here is how the file is opened:
>Store FOPEN('a:\NPC1.pcc') TO gnFileHandle && Open the file
>Store FSEEK(gnFileHandle, 0, 2) TO gnEnd && Move pointer to EOF
>Store FSEEK(gnFileHandle, 0) TO gnTop && Move pointer to BOF
>*-- gstring is the contents
>gcString = FGETS(gnFileHandle, gnEnd) && Store contents

Aside from others told you, you should also use FRead() instead of FGets(), because FGets() is line-oriented, i.e. it probably stops at the CR/LF boundary. Now since you are using the whole file at once, you don't need this LLFF stuff at all. Just acquire the whole file into a string using (guess what) FileToStr() function, grind it and chop it as you like, and write it back with StrToFile(). This has made my life much easier several times.

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