Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Current Printer Value - VFP 5.0
Message
 
 
À
14/04/2002 14:45:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00641611
Message ID:
00645883
Vues:
18
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform