David,

I played around with this a little using R:base 6.5++ for dos.  I think you
will get the same thing in Windows, but I didn't try it.

If you do the following, it requires user input, but an error is returned:

set var error var er
out printer
write 'Test'

-- Now if there is not a printer connected, You get the message "Printer is
not connected or out of paper"
If you press enter, you then get the messaage "Press Escape to quit or Enter
to continue"
If you press escape, the output goes back to the screen and the error var er
is 2865.

Obviousley the problem with this is that it requires user input and/or will
need to waste a page of paper.

I wonder if you you could use a playback file to send a couple of
escapes????


I tried using the NET USE command and mapping to my local printer, and that
does not work.  I get the error you can only  use that command for network
printers.

I suspect that it would be fairly easy to write a UDF in a VB program.
Windows know what printers are attached and ready to use.  How you would
want to write this program would depend on if you are using the DOS or
Windows version of R:base.  It might be worth a phone call to either Mike at
RBTI or Larry Lustig.  Maybe one of them would write you a UDF.  I am sure I
could do it, but it would take me a while to figure out the right way to
pass the results back from the UDF.

Troy


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of David M.
Blocker
Sent: Monday, December 01, 2003 2:56 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Detecting if the default printer is connected in
6.5++


Hi R:Base friends

Is there a way in R:Base 6.5++ to detect if a user's default printer is
actually connected?  I am working on an application where users will have
portable PC's and portable printers to take around on their work rounds.
They will periodically connect their portables to the network to move data
back and forth and will need to print reports.  We'd like to set it up so
that if the user connects his/her portable printer, it will print there, but
if not, to a different network printer.

Step one is to detect - is the default local printer connected?

David Blocker
[EMAIL PROTECTED]
781-784-1919
Fax: 781-784-1860
Cell: 339-206-0261

Reply via email to