Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to identify the default printer
Message
From
30/08/1999 12:38:23
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00258365
Message ID:
00259230
Views:
23
Ed, Cristobal,

>In VFP6, SET('PRINTER',3); I don't know of an equivalent under VFP5, so you'd need to track this in your application (doable with GETPRINTER(), since it returns a string name of the printer or a null string if cancelled, not with SYS(1037), which always returns a null string.)

One trick is to create a dummy quick report in the following manner:

create a dummy cursor:
CREATE CURSOR DUMMYCURSOR(DUMMY C)

then create a dummy quick report
CREATE REPORT DUMMYREPORT FROM DBF("DUMMYCURSOR")

open the report as a table:
USE Dummyreport.frx

And read the second line of the Expr field.
cDefaultFoxPrinter=STRTRAN(MLINE(Expr,2),"DEVICE=","")

It's kind of slow, but it seems to work.

Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform