Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 To: Brad Schulz
  Where is Brad Schulz?
 San Carlos
 California - United States
 Brad Schulz
 Tags
Subject: RE: SET ALTERNATE TO
Thread ID: 104321 Message ID: 104324 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Tuesday, August 15, 2006 5:56:42 AM         
   


> If you're outputting stuff with a ? command, then you're always going to get the initial blank line. That's because (by definition), a ? outputs a CRLF (Carriage Return Line Feed) BEFORE it outputs its stuff. You can change your code to instead do this:
>
> SCAN
> .....
> .....
> ?? string
> ?
> ENDSCAN
>
> As for the ending character, that may be a CHR(26), which is an ooooold-fashioned EOF marker.
>
> I've output stuff to file a lot in the past and I don't get this character. But I don't use SET ALTERNATE. Try instead using a SET PRINTER TO command like so:
>
> SET PRINTER TO &file_name
> SET PRINTER ON
> SET CONSOLE OFF
> ?? "My Output"
> ?
> SET CONSOLE ON
> SET PRINTER OFF
> SET PRINTER TO
>
> Hope this helps...
>
> --Brad
>
>
> > 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.

>
>
>
> --Brad



Brad,

Both problems fixed with your suggestions.

Thanks a lot!!

Russell.

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