PRB: Extra Blank Line When Printing Labels

Last reviewed: April 17, 1995
Article ID: Q99842
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.60

SYMPTOMS

When you are printing labels created with the label generator, an extra blank line is inserted as the first line of the printed output. On all subsequent pages, the contents of each label are then offset incrementally by one line.

CAUSE

This behavior existed in dBASE III and FoxBASE. It was changed in FoxPro version 1.02. However, to maintain compatibility with the large installed base of Xbase applications, a design decision was made to revert to the original behavior.

RESOLUTION

To work around this problem, print the label form to a file, open the file with low-level file functions, remove the carriage return/linefeed (CR/LF) characters and send the file to the printer using the MS-DOS COPY command. For example:

   *--Set the number of lines printed per page and print to a file.
   _PLENGTH=56
   LABEL FORM <form name> ENVIRONMENT PDSETUP TO FILE temp.txt

   *--Open file and replace the CR/LF pair with null characters.
   filehand=FOPEN('temp.txt',2)
   =FGETS(filehand)
   =FSEEK(filehand,-2,1)
   =FWRITE(filehand,chr(0)+chr(0))
   =FCLOSE(filehand)

   *--Copy the file to printer and prevent the appearance of the
   *--MS-DOS screen.
   HIDE WINDOW SAVE ALL
   RUN COPY temp.txt LPT1 > NUL
   SHOW WINDOW ALL


Additional reference words: FoxDos 2.00 2.50 2.50a 2.60
KBCategory: kbprg kbprb
KBSubcategory:


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: April 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.