Subject: | Re: PrinterSetCurrent
| Date: | 4 Aug 2017 00:59:39 -0400
| From: | "Kevin Zawicki" <numberjack@wi.rr.com>
| Newsgroups: | pnews.paradox-development
|
That is the way it works. For the session.
In some versions of pdox and OSes it hangs
for a long time or hangs forever, I have written a bunch of threads on this
(years ago). Though have not seen this in win10 paradox 9/10.
example
I read the current printer into a var, switch printer to pdf printer, print,
set printer back to what it was.
"Anders Jonsson" <anders.jonssonREMOVE@THISorrspelet.se> wrote:
>I'm almost certain it only affects Paradox and that the setting only affects
>the current session. Once you exit Paradox, everything is back to "normal".
>Should be easy to test.
>
>Anders
>
>
>
>"Steven Green" skrev i meddelandet
>news:59297690$1@pnews.thedbcommunity.com...
>
>so.. this becomes the temporary default FOR PARADOX ONLY, til you change
it
>again, or til you get out of paradox.. when you get out of paradox, it goes
>away, just like a session alias, your locks, open files, etc..
>
>
>--
>
>Steven Green
>Myrtle Beach, South Carolina, USA
>
>http://www.OasisTradingPost.com
>
>Collectibles and Memorabilia
>Vintage Lego Sets and Parts
>- and Paradox support, too
>
>"Anders Jonsson" wrote in message
>news:59291f01$1@pnews.thedbcommunity.com...
>
>First of all, the help files are wrong in P10. It states that the syntax
>sets the printer "on your system" but it's only for your Paradox session.
>The helpfiles also mention the printerinfo option, drivers and ports, but
>you only need the printername.
>
>I don't think there is an "undo", you have to use PrinterGetCurrent() and
>reset after.
>
>
>This is an example:
>
>method pushButton(var eventInfo Event)
>var
>r report
>tc tCursor
>pop PopUpMenu
>stSelected, stDefault string
>endvar
>
>stDefault=PrinterGetCurrent()
>
>EnumPrinters(tc)
>
>scan tc :
> pop.Addtext(tc.printerName)
>EndScan
>
>tc.close()
>
>pop.addseparator()
>pop.addText("Cancel")
>
>
>stSelected=pop.show()
>
>if stSelected="" or stSelected="Cancel"
> then
> ;cancel
> else
> if stDefault=stSelected
> then
> ;no need to do someting - just print
> r.print("EnkelLista")
> else
> ;change printer
> if not PrinterSetCurrent(stSelected)
> then
> errorshow()
> else
> sleep()
> r.print("EnkelLista")
>
> sleep()
> ;reset
>
> if not PrinterSetCurrent(stDefault)
> then
> errorshow()
> endif
> endif
> endif
>endif
>endMethod
>
>
>Anders
>
>
>
>"Steven Green" skrev i meddelandet
>news:5928812f$1@pnews.thedbcommunity.com...
>
>stupid question of the day
>
>PrinterSetCurrent()
>
>what is the expected behavior? does this function replace the default? does
>it expire at the end of the form in use, end of session, etc? can you "undo"
>it with a generic call, like when you call switchindex or setrange, where
>you "undo" the current restriction..
>
>
>--
>
>Steven Green
>Myrtle Beach, South Carolina, USA
>
>http://www.OasisTradingPost.com
>
>Collectibles and Memorabilia
>Vintage Lego Sets and Parts
>- and Paradox support, too
>
>
>---
>This email has been checked for viruses by Avast antivirus software.
>https://www.avast.com/antivirus
>
|