Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LastKey()

Status
Not open for further replies.

maryhale

Programmer
Oct 18, 2006
6
GB
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.

Thanks,
Mary
 
Mary,

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)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike,

I haven't tried anything yet, but I believe you pointed me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top