Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fputs()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00365294
Message ID:
00365306
Vues:
21
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform