Microsoft KB Archive/114186

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b

-

SUMMARY
In FoxPro for Windows, when you combine the SET PRINTER ON command with the ??? command to output data to a printer, a blank page ejects prior to the print job being sent.

CAUSE
When the SET PRINT ON command is issued, a print job is started. When the ??? command is issued, the current print job is closed, and a new raw print job is opened.

In FoxPro for Windows, when a print job is opened and then closed, a blank page will be printed even if no output was sent.

WORKAROUND
In FoxPro for MS-DOS, create a printer driver using the Generic printer settings. You can then use this printer driver in FoxPro for Windows.

To do this:

  Load FoxPro for MS-DOS. Set your resource (FOXUSER) file to the one that you will use for your FoxPro for Windows applications. If this is the resource file in your FoxPro for Windows directory and that directory is called FOXPROW and is located on drive C, type the following command:       SET RESOURCE TO c:\foxprow\foxuser Doing this ensures that the printer driver is stored in the correct resource file.  From the File menu, choose Printer Setup. Select the Printer Driver Setup check box, and then choose New. In the Printers list box, scroll down to the Generic Printer driver. In the Setup Name box, type "Generic" (without the quotation marks), and then choose OK. In the Printer Driver Setups dialog box, choose either Cancel or Set. It does not matter for the purpose of creating the printer driver. In the Printer Setup dialog box, choose OK.  Exit FoxPro for MS-DOS. Load FoxPro for Windows. In the Command window, type:  <pre class="CODESAMP">    SET PDSETUP TO "Generic" SET PRINTER ON    ??? ''                             && Opens printer in 'raw' mode ? "I set the printer in raw mode" ??? CHR(27)+"(s3B"    ? "I am printing bold"     ??? CHR (27) + "(s0B" ? "Now it's not bold" SET PRINTER OFF SET PRINTER TO </li></ol>

For additional information, please see the following article(s) in the Microsoft Knowledge Base: "Q99542 Printing Reports Created w/ Question Marks in FP for Win"

Steps to Reproduce Problem
The following code causes a blank page to eject prior to the print job that is sent. It seems that the page eject occurs at the location of the first ??? command (that is, if you remove the first ??? command, the page eject occurs after the first line of text is printed).  <pre class="CODESAMP">  ** The escape codes in this program are for an HP laser printer. ** They are for illustration purposes only.

SET PRINTER ON  ??? ''                            && Opens printer in 'raw' mode ? "I set the printer in raw mode" ??? CHR(27)+"(s3B"  ? "I am printing bold"   ??? CHR (27) + "(s0B" ? "Now it's not bold" SET PRINTER OFF SET PRINTER TO Additional query words: FoxWin 2.50

Keywords         : FxprintRaw Version          : 2.50 2.50a 2.50b Platform         : WINDOWS Issue type       :
 * }