Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fputs()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00365294
Message ID:
00365306
Views:
22
>Hello,
> I used the fopen("dummy",2) and fputs() to append data to a text file. It overwrote the exist data instead of append to the text file. What did I do wrong ? thanks
>nFile=fopen("dummy",2)
>if nfile > 0
> = fputs(nfile,"test")
>endif
>fclose(nfile)
>sherry

Sherry, you have to position to the end of file before writing.
=fseek(nfile, 0, 2)
= fputs(nfile,"test")

Consider also using STRTOFILE() function (VFP6) instead of low-level functions.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform