PRB: Printing @ ... SAYs is Slow in FoxPro/DOS Under Win95

ID: Q164743


The information in this article applies to:


SYMPTOMS

Printing @ ... SAYs from FoxPro for MS-DOS to some network printers under Windows 95 on a Windows NT network is slow. The output comes out of other printers much more quickly.


CAUSE

The printers that are slow to release the print jobs are captured on the LPT2 or LPT3 ports.


RESOLUTION

Capture the printers on LPT ports other than LPT2 and LPT3.

To change the port that the printer is captured under, follow these steps:

  1. From the Windows 95 Start menu, choose Settings and then Printers.


  2. Click the desired printer icon to select it.


  3. Right-click the selected printer icon and select Properties.


  4. In the Properties dialog box, click the Details tab.


  5. Click End Capture and (if more than one printer is listed) select the printer that is on LPT2 or LPT3. Click OK to end the capture of the printer port.


  6. In the Properties dialog box, click Capture Printer Port...


  7. Choose any LPT port except LPT2 or LPT3 from the Device dropdown list.


  8. In the Path dropdown list, choose the path to the network printer or type the path in if it is not listed.


  9. Click OK.


Note that the LPT ports listed in the Capture Printer Port... dialog box are logical ports. They do not need to be physically available on the computer.


MORE INFORMATION

Because printing is very complex and the printer, network and configuration of the computer can have a major influence on it, the scope of this article is very narrow. However, if the scenario described herein applies, the resolution should solve the problem.



The resolution should work if you are running FoxPro for MS-DOS in a DOS window under Windows 95. The network should either be a Windows NT or Windows 95 network. The printers should be shared via the network.

In order to print from MS-DOS based programs, printers in Windows 95 need to be captured. The Add Printer Wizard in Windows 95 asks this question when setting up an new printer.

Printing reports in FoxPro for MS-DOS exhibits similar behavior as the @ SAY commands. However, without issuing the SET PRINTER TO command after the REPORT FORM command, the report will still come out slowly. By issuing SET PRINTER TO immediately after the REPORT FORM command, it allow the report to start printing immediately if the printer is captured on any LPT port except LPT2 or LPT3. Some sample code follows:


SET PRINTER TO LPT1
REPORT FORM <whatever> TO PRINT
SET PRINTER TO 

Steps to Reproduce Behavior

  1. Follow the steps in the resolution section to capture a network printer on the LPT1 port.


  2. In the FoxPro for MS-DOS Command window, type the following commands:
    
    SET PRINTER TO
    SET DEVICE TO PRINTER
    SET PRINTER TO LPT1
    @ 1,1 SAY "Hello"
    @ 2,1 SAY "Goodbye"
    SET PRINTER TO          && The print job should start printing now.
    SET DEVICE TO SCREEN 
    Note that as soon as the second SET PRINTER TO command is issued when the printer is captured on LPT1, the print job starts printing immediately.


  3. Capture the same network printer on the LPT2 or LPT3 port following the steps in the resolution section. Be sure to End Capture the printer from the LPT1 port first.


  4. Repeat the commands in step 2 above substituting LPT2 (or LPT3) for LPT1 in the SET PRINTER TO LPT1 command. Note that the print job does not immediately come out when the SET PRINTER TO command is issued. In fact, it may not come out at all until FoxPro is exited. Even a second SET PRINTER TO command after the @ ... SAYs will not cause the print job to be released.


  5. Repeat all this using LPT4, LPT5, LPT6 or higher. The print job should be released immediately after the SET PRINTER TO command with all ports except LPT2 and LPT3.



REFERENCES

Microsoft "Windows 95 Resource Kit," pages 393-394, 602, 781

Additional query words: @..SAYs


Keywords          : kbprint FoxDos FxprintGeneral FxprintNet 
Version           : MS-DOS:2.6a
Platform          : MS-DOS 
Issue type        : kbprb 

Last Reviewed: March 7, 1999