Solved

User abort of program flow

Posted on 1997-09-13
3
204 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

822 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