Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Low Level File Blues
Message
From
16/08/2000 13:42:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00405598
Message ID:
00405646
Views:
16
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform