Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating and saving multiple texts
Message
From
23/05/2010 17:56:06
 
 
To
23/05/2010 17:42:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01465655
Message ID:
01465657
Views:
36
tnx hilmar.
I seem to lose my chr(13) formatting in the filetostr (that's my added text between the text file) - although the formatting of the actual text files remains in tact.

k

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform