Hi Vernon,
First, in assigning the new printer, some of the information
needs to be removed. Here's the revision:
Get the necessary information for the Generic/Text Only printer.
m.buffer = SPACE(100) + CHR(0)
m.buflen = LEN(m.buffer)
m.buflen = CallFN(m.getstr, 'PrinterPorts', 'Generic / Text Only',;
"", @buffer, m.buflen)
m.txtprn = LEFT(m.buffer, m.buflen)
* Adding the following
m.txtprn = LEFT(m.txtprn, AT(':', m.txtprn))
* End addition
m.newdefprn = 'Generic / Text Only,' + m.txtprn
= CallFN(m.writestr, m.winsect, 'device', m.newdefprn)
etc.
Your problem may be caused be not sending back the original
default as you got it. I experienced the same problem you had
by sending the wrong information. The format of the string
should be:
,,
For example:
Generic / Text Only,TTY,LPT1:
When you retrieve information from the PrinterPorts, you need to
remove everything after the port. That's what the new line does.
I switched between a regular printer and the generic on LPT1:
from the command window I (after making the above change) didn't
have the problem.
If you have any other questions or problems, either post or email
me at GTasker@compuserve.com. I don't mind having my goofs
(like this one) posted for all the world to see.
My apologies for any inconvenince.
Good Luck,
George
George
Ubi caritas et amor, deus ibi est