Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

User abort of program flow

Posted on 1997-09-13
3
Medium Priority
?
211 Views
Last Modified: 2010-04-04
I want to be able to abort some calculations if the user presses a key or clicks the mouse.

I'd like to be able to do this without the hassle of setting up a 2ndthread.

Any ideas?

Cheers Chris
0
Comment
Question by:chrishart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
98113772 earned 300 total points
ID: 1344752
An idea could be, that in the OnClick of the button, you set a variable to true. Before you start your calculation, set the same variable to False.

In your calculation have the following lines:

[...]
Application.ProcessMessages;
If <Your_VariableName> then exit;
[...]
0
 

Author Comment

by:chrishart
ID: 1344753
Thanks, 98113772, that's the sort of answer I was looking for :-)

Didn't know about the process messages command.

Cheers chris

PS 20 bonus points for mega fast response!
0
 

Expert Comment

by:98113772
ID: 1344754
Thanks for the bonus
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question