Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_pscode system variable

Status
Not open for further replies.

capri1966

Programmer
May 13, 2010
57
ES
Hello, i'm developing an application that print tickets on a matrix printer and in the
help file, i've found the _pscode system variable that send control codes to a printer
and the help file not explain how to use this variable. Can anybody send me some information
about the '_pscode. Thank you
 
It's very unusual to use _pscode in Visual FoxPro. It's a remnant of the old DOS versions of FoxPro.

Nowadays, you would use a printer driver to control the printer. That way, you won't need to send control codes. Assuming you have a driver for the printer, you should use the VFP report designer to create your tickets. You'll find that a lot easier.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I know that _pscode is an old system variable, but i have to use it instead of the report designer.
 
I agree with Mike, there is NOT MUCH that can be done with _pscode that cannot be done in a VFP Report Form.

And doing the work in a VFP Report Form is MUCH easier.

Good Luck,
JRB-Bldr
 
_pscode and _pecode are two variables containing the codes you want to send at start and end of a PRINTJOB, which you start with RPINTJOB and end with ENDPRINTJOB. So the PS in _PSCODE doesn't stand for postscript, it's start for printjob start code and _pecode stands for printjob end code But essentially all you need to print directly to a legacy printer without any printer driver is to make use of ???. Espoecially after you installed the Genereic/Text Printer driver and set that printer as your current printer to use in VFP via SET PRINTER TO NAME "Gneric / Text only" (may differ in your Windows Version), because it's the only way to directly print what you want to without any driver interfering with the codes you send.

But in the end I second the question of my collegues. ??? was one of the only ways to print to sepcific Zebra or Dymo label printers but Windows printer drivers exist for them, too, and nothing is easier than designing a label LBX in Foxpro with it's designer. It knows label formats already etc. and allows a much more comfortble design of output label printing some data than doing the low level stuff of printing printer control codes which then only work an that spefic printer.

Bye, Olaf.
 
i'm developing an application that print tickets on a matrix printer

And, to go a step further, since you are Developing it yourself NOW, why not do it with current development methods?

Good Luck,
JRB-Bldr

 
The problem is you can't send stuff that way anymore. In the old days of DOS, you talked directly to the printer driver. You don't do that anymore. You talk to Windows that talks to the printer driver. And Windows won't let you send stuff before and after like you want.

Craig Berntson
MCSD, Visual C# MVP,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top