The information in this article applies to:
SUMMARY
Controlling what printer a program prints to can be accomplished through
code with the enhancements to the SET PRINTER TO command in Visual FoxPro
run with QuickDraw GX and some other new functions. This article provides a
sample program combining the SYS(1038), the JustCSName() and the SET
PRINTER TO NAME enhancements to illustrate how to control which printer a
report is printed to.
MORE INFORMATIONSample ProgramThe following sample program assumes that QuickDraw GX is installed, that at least two printers are set up, and that their icons are on the desktop:
Program CommentaryThe first line in the program checks to see if QuickDraw GX is installed by using the SYS(1038) function.The second line determines the name of the Macintosh's hard drive by using the SYS(2033) function, and appends "Desktop Folder" to it. The third line checks to see how many QuickDraw GX printer icons are on the desktop and stores their names in an array named "prtList". The 'dvcf' in the fourth argument of the ADIR() function is the creator type of the QuickDraw GX printer icons. The fourth line loads the FoxTools.cfm library, which is necessary for the use of the JustCSName function. The fifth line is the beginning of a FOR loop that executes once for each QuickDraw GX printer icon found on the desktop. The sixth line (the first one in the FOR loop) sets the printer to one of the QuickDraw GX printers found on the desktop. The seventh line prints a predefined report. The eighth line reports the name of the current QuickDraw GX printer to the current output device (the Visual FoxPro screen). REFERENCESFor additional information, please see the following articles in the Microsoft Knowledge Base: Q152396 How To Determine if QuickDraw GX Is Loaded Using SYS Function Q153155 How To Use New Undocumented Foxtools Function JustCSName() Q153528 SET PRINTER TO Enhancements in Visual FoxPro for Macintosh Additional query words: VFoxMac
Keywords : kb3rdparty FxprgGeneral |
Last Reviewed: December 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |