Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer settings command
Message
From
30/01/2017 05:45:10
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
30/01/2017 05:23:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2008 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01647147
Message ID:
01647153
Views:
49
This message has been marked as a message which has helped to the initial question of the thread.
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 &&!EMPTY(lcPrinter)
  ELSE &&Val(Os(3))*100+Val(Os(4))>=600
   =SYS(1037)
  ENDIF &&Val(Os(3))*100+Val(Os(4))>=600
 CATCH TO loException WHEN loException.ERRORNO=125
* no printer found
  llError = True
 CATCH TO loException
* other error, add your handler
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.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform