The cause of your problems is indeed Windows' control of the printer.
Generally, your best bet is to create a single file which you then dump to the appropriate printer. First, create a file containing your printer initialization codes. I haven't tested this, but you can probably SET ALTERNATE TO a file, then run your ??? commands, to place them in that file.
****************************************
SET ALTERNATE TO InitFile
??? your printer init commands
???
???
SET ALTERNATE TO &&closes the InitFile
* If your Init commands are always the same, you could manually
* create the Initfile and not bother with the above.
*You then need to combine this init file with your text file. A single DOS *command can do this, so you could RUN it from within VFP e.g.
RUN COPY InitFile+TextFile OutputFile
*You then issue a native VFP COPY command to dump the result to the printer:
COPY FILE OutputFile TO LPTx.DOS
****************************************
Since you've been printing using FPD, you probably already have DOS printer ports captured appropriately, so the above should work.
>Hope someone can help with this. I have some txt files that get loaded onto my network from a main frame. These files are ment to be printed on 11x17 paper. In the past using 2.6 Dos I have used PCl Commands to set the printer up before issuing the Type myfile.txt to printer. The time finally came to port this App over to VFP6.0... well to make a long story end. Why does the following not work in VFP 6/5:
>
> ???
> ???
>ETC.
>
>I assume its because windows wants to control the printer.. Is there a way around it?
>
>As Always
>Thanks in advance and
>Thanks for everyone that has helped in the past.
>
>Bob Buske
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up