What is the best way to terminate a series of print jobs?
LastKey() doesn't always work because apparently some third party software used to print PDF files is stuffing the keyboard buffer with strange characters.
I assume you want to do this programmatically? And, when you say printjobs, you mean a series of reports?
Also, do you want to be able to interrupt a report in the middle, or is it enough to interrupt the process between any two reports?
If the former, the only reliable way to do it programmatically (as far as I know) it to use API calls direct into the Windows Print Manager.
Alternatively, you could simply SET ESCAPE ON and let the user press ESC, but you have no programmatic control over that (for example, you can't issue an "Are you sure?" message, and you won't know if or when the user has done it).
If you are happy to let the user interrupt between reports, the best way is to have a Cancel button on your form (the one that launches the reports). In the Click, set a form property to .t.. Then test that flag just after you print each report. Be sure to call DOEVENTS at regular intervals to ensure that the button's Click gets processed.
Hope this answers your question. I'm not sure where LASTKEY() comes into it.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.