Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current Printer Value - VFP 5.0
Message
 
 
To
14/04/2002 14:45:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00641611
Message ID:
00645883
Views:
17
Hi Rick,

I did more testing and found out that on my PC (WIN2K PRO) the name of the default printer (it's network printer) stored in Expr filed in the 'OUTPUT=" line not "DEVICE=". I would suggest to do more testing of this code.

>That does it alright. Thank you very much. (I'd tried something similar, but was missing the cursor creation, and it just didn't work right.)
>
>Rick
>
>>>Anyone know of a routine that can give the equivalent of SET("PRINTER", 3) in VFP 5.0? I've got to retrofit some working 6.0 / 7.0 code back into a 5.0 application. <s>
>>>
>>>Rick
>>
>>Just an idea. You can create a quick report and extract the printer name from it's EXPR field. Something like
*Function SetPrinter3()
>>LOCAL LcCursorName, lcReportName, lnLine, lcPrinterName, lcStr
>>LcCursorName = Sys(2015)
>>lcReportName = Sys(2015)
>>CREATE CURSOR (lcCursorName) ( temp C(1))
>>CREATE REPORT (lcReportName ) FROM (lcCursorName )
>>USE (lcReportName + ".FRX")
>>lnLine = Atline("DEVICE=", Expr)
>>lcStr = Mline(Expr, lnLine)
>>lcPrinterName = Substr( lcStr,  At("=", lcStr )+1)
>>USE IN (lcReportName)
>>ERASE (lcReportName + ".FRX")
>>ERASE (lcReportName + ".FRT")
>>RETURN UPPER(lcPrinterName)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform