Solved

User abort of program flow

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 105
Correct Component for Shopping Cart. 2 121
Making delphi communicate with a c# service 16 122
drawing animated level bar based on numbers 3 111
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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