The SET PRINTER TO command has been enhanced in Visual FoxPro for theMacintosh. Its functionality differs depending on whether or not QuickDrawGX is installed. This article describes the new enhancements that are notdescribed in the Visual FoxPro Help file.
Note: Since Macintosh OS 8 no longer supports QuickDraw GX printer driversor printing extensions, the SET PRINTER TO NAME "<QuickDraw GX printerdriver name>" command no longer functions in Visual FoxPro with MacintoshOS 8. For more information on the changes to QuickDraw GX with OS 8 referto the About QuickDraw GX read me file in the Mac OS Read Me folder on theOS 8 CD-ROM.
Without QuickDraw GX
A new feature of the SET PRINTER TO command that is available only whenQuickDraw GX is not installed is the ability to set all the page setupoptions for the current printer back to their default values. The commandto do this is:
To test this, try these steps:
- Make sure a printer is selected in Chooser.
- Start Visual FoxPro.
- Choose the Page Setup command from the File menu. Change the settings to something other than what they are. Choose OK.
- In the Command window, type:
- Go back into Page Setup, and observe that all the settings are back to what they were originally (before they were changed in step 3).
Note that when QuickDraw GX is not used, Visual FoxPro always uses theprinter that was selected in Chooser, which is the default printer of thesystem.
With QuickDraw GX
NOTE: QuickDraw GX is manufactured by a vendor independent of Microsoft; wemake no warranty, implied or otherwise, regarding the performance orreliability of QuickDraw GX.
The SET PRINTER TO enhancements with QuickDraw GX loaded allow more controlover the selection of the printer to be used. These enhancements work withthe current versions of QuickDraw GX (this article was tested with version1.1.2). Future changes to the Macintosh operating system and QuickDraw GXmay cause these enhancements to stop functioning.
With QuickDraw GX, different printers are set up as icons on the Macintoshdesktop. These printers have names that can be referenced in Visual FoxPro.These names can be used with the SET PRINTER TO NAME command to redirect aa Visual FoxPro print job to a different printer.
For examaple, on the Macintosh desktop, there may be an ImageWriter GXprinter and a LaserWriter with name of 4SI@2253. In Visual FoxPro thefollowing commands can be used to switch the current printer:
SET PRINTER TO NAME "ImageWriter GX" SET PRINTER TO NAME "4SI@2253"
The first command directs Visual FoxPro's print jobs to the ImageWriter GXprinter, and the second directs print jobs to the 4SI printer by way of theLaserWriter GX printer driver.
NOTE: The names of the printers setup on the desktop are case sensitive inthe SET PRINTER TO NAME "<printer name>" command. The quotation marks areoptional if the printer name does not have spaces in it.
With QuickDraw GX, there is a default printer for the Macintosh system. Theicon that shows on the desktop for the default printer has a thick blackborder. In Visual FoxPro, if the Visual FoxPro printer is changed with theSET PRINTER TO NAME <printer name> command, the SET PRINTER TO DEFAULTcommand will set the Visual FoxPro printer back to the printer that is thedefault for the Macintosh system.
You can use the SET("Printer",2) command to determine which printer VisualFoxPro will print to. To see this in action, enter the following code inthe Visual FoxPro Command window:
? SET("Printer",2) SET PRINTER TO NAME "ImageWriter GX" ? SET("Printer",2) SET PRINTER TO DEFAULT