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
>>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--