FIX: EJECT Command with a Printer Driver Loaded

ID: Q97639

2.50    | 2.00 2.50
WINDOWS | MS-DOS kbprg kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

The first EJECT command issued after a printer driver is assigned is not sent to the output destination.

RESOLUTION

To correct this problem in the program shown below, include the following code in the program that uses the EJECT command after the printer driver has been assigned:

   SET TALK OFF
   X=SET("PRINTER",1)
   SET PRINTER TO JUNK.TXT
   EJECT
   SET PRINTER TO &X

STATUS

Microsoft has confirmed this to be a problem in FoxPro versions 2.0 and 2.5 for MS-DOS. This problem was corrected in FoxPro version 2.5a for MS-DOS.

MORE INFORMATION

The following code will reproduce this problem:

   * This section of code reproduces the problem in JUNK.TXT, because
   * a printer driver was set.

   SET PDSETUP TO <Printer Driver Setup Name>
   SET PRINTER TO JUNK.TXT
   EJECT
   EJECT
   SET PRINTER TO

   * This section of code works correctly, because the printer driver
   * was not set again.

   SET PRINTER TO NEWJUNK.TXT
   EJECT
   EJECT
   SET PRINTER TO

After a printer driver is chosen, the first EJECT command executed will not send a formfeed character to the output destination. The file JUNK.TXT demonstrates this problem, as it contains only one formfeed character.

Any time a second EJECT command is executed after the first EJECT command is executed without changing the printer driver, a formfeed character will be sent to the output destination. The file NEWJUNK.TXT demonstrates this behavior, as it contains two formfeed characters.

Without a default printer driver or a printer driver loaded, both files will always work correctly and contain two formfeed characters.

Additional reference words: FoxDos FoxWin 2.00 2.50 form feed buglist2.00 buglist2.50 fixlist2.50a KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgGeneral

Keywords          : FxprgGeneral kbbuglist kbfixlist
Version           : 2.50    | 2.00 2.50
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: September 24, 1997