Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating and saving multiple texts
Message
De
23/05/2010 17:42:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01465655
Message ID:
01465656
Vues:
51
Several options. One of the simplest is the converse of FileToStr(), namely, StrToFile(). It will save the specified expression (e.g., etext0 + etext1 + etext2) to disk. Nor do you have to save it all at once; there is an "append" option that allows you to add to the end of an existing file.

Another option is low-level file functions. Probably more efficient if you want to add several pieces to a file, but it requires more commands. I suggest you start with StrToFile(), due to its simplicity.

>combining text files into one composite text file is not a problem - below seems to work.
>However i am having difficulty saving the result - maybe i'm standing too close and missing the obvious.
>i would like to save etext2 in c:/mydirectory as a new text3.txt
>any suggestions will be appreciated:
>
>etext0=FILETOSTR("c:\mytext\words1.txt")
>etext1=FILETOSTR('c:\mytext\words2.txt')
>etext2="Words of etext0"+CHR(13)+etext1+CHR(13)+"_______________________"+CHR(13)+"words of etext2:"+CHR(13)+etext1 
>
>
>thanks
>k
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform