Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: ian pano
  Where is ian pano?
 Metro Manila
 Philippines
 ian pano
 Tags
Subject: RE: Writing to text file
Thread ID: 104628 Message ID: 104630 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Friday, August 18, 2006 4:01:27 PM         
   


> Hi Experts,
>
> FPUTS Writes a character string, carriage return, and line feed to a file
> FWRITE does not.
>
> i need to write a character string to a file then using only line feed i must be able to write another to next line. is this possible?
>
>
> TIA
>
>
> .ian.pano.

It is easier (if the text file you want to write is not huge) to use TEXTMERGE:
SET TEXTMERGE TO lcStr ADDITIVE NOSHOW
SET TEXTMERGE ON
SELECT MyAlias
SCAN
\ New Line Text line 
\\ second column to first line
\\ <<Field1>>
ENDSCAN
STRTOFILE(lcStr,[MyTextFile.TXT])
SET TEXTMERGE TO 
SET TEXTMERGE OFF


or directly to file
SET TEXTMERGE TO MyTextFile.TXT ADDITIVE NOSHOW
SET TEXTMERGE ON
SELECT MyAlias
SCAN
\<font color="Blue">New Line Text line 
\\ second column to first line
\\ <<Field1>>
ENDSCAN
SET TEXTMERGE TO 
SET TEXTMERGE OFF


BTW if you want to use FWRITE() you must put CRLF at the end of the line
#define CRLF CHR(13)+CHR(10)
FWRITE(fHndl,[bla bla bla]+CRLF)


Borislav Borissov



ENTIRE THREAD

Writing to text file Posted by Christian Pano @ 8/18/2006 3:54:59 PM
RE: Writing to text file Posted by Borislav Borissov @ 8/18/2006 4:01:27 PM
RE: Writing to text file Posted by Ken Murphy @ 8/18/2006 4:08:30 PM
RE: Writing to text file Posted by Christian Pano @ 8/18/2006 4:31:07 PM
RE: Writing to text file Posted by Ken Murphy @ 8/18/2006 6:02:17 PM
RE: Writing to text file Posted by Binod Binani @ 8/20/2006 5:48:56 AM
RE: Writing to text file Posted by tushar @ 8/20/2006 9:41:05 AM
RE: Writing to text file Posted by Ken Murphy @ 8/20/2006 2:21:20 PM