Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Low Level File Blues
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00405598
Message ID:
00405616
Views:
19
Thanks! I have been staring at that for too loong and not seeing it!



>The first parameter in Fwrite, Fputs, Fflush and Fclose has to be a file handle from Fopen. It's gnFileHandle in your case .
>

>>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
>>*-- what we started with
>>g1=gcString
>>
>>I find my bits, switch them and then try to FWRITE() but it returns 0, and the changes are not stored.
>>
>>Here is my closing :
>>w=Fwrite('a:\NPC1.pcc', gcString, gnEnd)
>>
>>fflush('a:\NPC1.pcc')
>>fclose('a:\NPC1.pcc')
>>
>>W will always = 0?
>>
>>What am i missing?
>>
>>If I do :
>>y=fputs('a:\NPC1.pcc', gcString, gnEnd)
>>it give no result = 0
>>
>>TIA
>>__Stephen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform