Although it may be posible to check whether the selected printer still is active or not, I suggest something like
lcPrinter=GetPrinter()
if empty(lcPrinter)
Set printer to default
else
Set printer to name (lcPrinter)
endif
For RawPrint I guess you must add something like
oPrintdev1.cPrinterName = Set("Printer",3)
>Please take a look if this method of get printer is better than mine
>
>
>> lcPrinter = GetPrinter()
>> IF EMPTY(lcPrinter)
>> RETURN
>> ENDIF
>> SET PRINTER TO DEFAULT
>> oPrintdev1.cPrinterName = ALLTRIM(lcPrinter)
>
>beside my code, it includs
>
> SET PRINTER TO DEFAULT, alltrim, and if empty ()
>
>Can this be relevant to possible getprinter error ?
>
>
>It is a piece of Borissov code I picked up in foxite
>
>If he is here, I would like to hear his opinion too
>
>Moises