Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing to file with ? commands
Message
From
28/01/2008 11:37:38
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
01286038
Message ID:
01286167
Views:
27
>>>It has been so long since I did this I don't remember how to do it. I am working with an ancient FoxPro DOS program that prints reports with ? commands. The reports are voluminous and I want to direct them to files rather than use up reams of paper. Have been monkeying around with the SET PRINTER TO command, and do get a file, but it consists only of a few special characters. (There is output which I see on the screen). Can someone please remind me how to do this? Running VFP 9 under Windows XP.
>>
>>
>>* Enable output
>>set console off
>>set alternate to MyText.txt
>>set alternate on
>>
>>* Run the report
>>? "Hello World
>>
>>* Disable output
>>set alternate off
>>set alternate to
>>
>>* Show the report
>>modify command MyText.txt
>>* Or better, use FAQ #8134
>>
>>
>>For text reports, see also download #9991.
>
>
>Works like a champ! Thank you very much.
>
>I don't believe I had ever used the SET ALTERNATE command before, in any version of FoxPro....

A word of warning - set Alternate will add an eof marker (ASCII 26) to the end of file when you close it. Opening the file in some editors will hide any content beyond that point, while in others it won't. So if you pass such a file around, some may add to it and pass it on, and then some of the recipients of that wouldn't see anything below the EOF marker.

This is the sole reason why my preferred method was to Set Print On, Set Print To {filename} - which was in DOS days, before FP2.0. Since then, we have textmerge, which is much easier, and you can combine several technigues to create text.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform