>>>Dear folks:
>>>
>>>I want to print one job in lpt1 and other job in lpt2. So I tried to use set printer to lpt1 and send printing job to printer, and set printer to lpt2 and send printing job to printer. But two jobs printed out to lpt1 printer.
>>>
>>>I used set printer to name XXX(lpt2) and send the data. but VFP change the printer to that name still does not print two job separately in two printer.
>>>It prints only one printer either lpt1 or lpt2.
>>>
>>>Is there any who can help me with this?
>>>
>>>Thank you in advance.
>>
>>If you are using a variable to hold the printer name you need to enclose the name in parentheses (). Your code should probably look like
>>SET PRINTER TO NAME (PrinterName). This works fine for me.
>
>Larry,
>
>PMFJI, but should the printer name in quotes ("PrinterName") or not (PrinterName)? Not questioning your advice, just asking as I have a similar problem right going on, but don't have the code in front of me. Thanks!
>
>Renoir
I can see where you might have been confused. As I was mentioned in my reponse I was intending that a variable contain the name of the printer (PrinterName = "\\SERVER01\PRINTER01"). That is how my code works. I put the printer name in a variable and then enclose the printer name variable in parentheses.
From what I can tell by my testing, it seems that SET PRINTER TO LPT2 doesn't do anything in VFP even if LPT2 is connected to a network printer. You need to use the form of SET PRINTER TO NAME (PrinterName) where PrinterName is a variable that contains the name of the printer as found in the Printers control panel and/or the APRINTERS() function.
Larry Huisingh
Lockheed Martin Information Technology
Richland WA USA