What I do for general switching:
LOCAL;
lcPrinter AS CHARACTER,;
llError AS BOOLEAN,;
loException AS EXCEPTION
TRY
IF VAL(OS(3))*100+VAL(OS(4))>=600 THEN
lcPrinter = GETPRINTER()
IF !EMPTY(lcPrinter) THEN
SET PRINTER TO NAME (lcPrinter)
=SYS(1037)
ENDIF
ELSE
=SYS(1037)
ENDIF
CATCH TO loException WHEN loException.ERRORNO=125
llError = True
CATCH TO loException
ENDTRY
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]