Solved

User abort of program flow

Posted on 1997-09-13
3
202 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
  • 2
3 Comments
 

Accepted Solution

by:
98113772 earned 100 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now