FIX: EJECT Command with a Printer Driver Loaded

Last reviewed: September 22, 1997
Article ID: Q97639
2.50    | 2.00 2.50
WINDOWS | MS-DOS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5
  • Microsoft FoxPro for MS-DOS, versions 2.0 and 2.5

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 kbprg
Version : 2.50 | 2.00 2.50
Platform : MS-DOS WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.