>>>Hi All:
>>>
>>>How can I retrieve the default printer so that I can do something like this:
>>>
>>>
>>>* Print a report
>>>do Printreport
>>>* Print a receipt on the receipt printer
>>>lcOldPrinter = defaultprinter()
>>>set printer to name 'Star TSP643 Raster Printer'
>>>do PrintReceipt
>>>* Restore reguler printer
>>>set printer to name &lcOldPrinter
>>>
>>>
>>>Thanks,
>>>
>>>Yossi
>>
>>Yossi,
>>
>>Do you mean
>>
>>
Default Windows Printer ?
>
>I looked further in the article you provided and found that
>
>
>SET("PRINTER", 2)
>
>
>seems to be what I'm looking for.
>
>So why do I need all that fancy API code and why is it not enough to say
>
>
>* Print a report
>do Printreport
>* Print a receipt on the receipt printer
>lcOldPrinter = SET("PRINTER", 2)
>set printer to name 'Star TSP643 Raster Printer'
>do PrintReceipt
>* Restore regular printer
>set printer to name &lcOldPrinter
>
>
>Especially since the help defines the SET("PRINTER", 2) as the 'Default Windows printer name'?!
Yes, I was thinking you can just use SET("printer",2). It was not clear what you're after in your original question.
If it's not broken, fix it until it is.
My Blog