Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: SET ALTERNATE TO
Thread ID: 104321 Message ID: 104361 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Tuesday, August 15, 2006 12:49:11 PM         
   


> Hi all,
>
> I am using the following code to create a .txt file.
>
> SET ALTERNATE TO &file_name
> SET ALTERNATE ON
> SET CONSOLE OFF
> SCAN
> .....
> .....
> ?string
> ENDSCAN
> SET CONSOLE ON
> SET ALTERNATE OFF
> CLOSE ALTERNATE
>
> I have two little problems I would like to fix:
>
> 1. There is a blank line at the very start of the .txt file. Can I lose this programatically?
>
> 2. There is a "funny" character directly after (and on the same line as) the last character on the last line. Can I similarly lose this character (it's like a tiny little rectangle with height > width).
>
> Thanks,
>
> Russell.


Why not use STRTOFILE()? You only get what you want in the file and it's a LOT easier....

Just remember you need to add the CRLF explicitly or else you get one long string....
lcOutStr = ""
SCAN
  lcOutStr = lcOutStr + [whatever] + CHR(13)+CHR(10)
ENDSCAN
STRTOFILE( lcOutStr, (file_name) )  


Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

SET ALTERNATE TO Posted by Russell Hill @ 8/15/2006 5:16:49 AM
RE: SET ALTERNATE TO Posted by Brad Schulz @ 8/15/2006 5:24:11 AM
RE: SET ALTERNATE TO Posted by Russell Hill @ 8/15/2006 5:56:42 AM
RE: SET ALTERNATE TO Posted by Andy Kramek @ 8/15/2006 12:49:11 PM
RE: SET ALTERNATE TO Posted by Russell Hill @ 8/16/2006 12:40:30 AM