?
Solved

Stopping Processing...

Posted on 1998-10-05
3
Medium Priority
?
131 Views
Last Modified: 2010-04-06
Hi..
  I wish to have a 'Stop' or 'cancel' button in my application such that when clicked by the user in the middle of a processing job, the app will cease processing and return to the ready state. How can I do this?

Cheers
   Shawn Halfpenny
0
Comment
Question by:aztec
[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
3 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1341820
And what state is that??? Give some sample codes or something similar...

Regards,
Viktor Ivanov
0
 

Accepted Solution

by:
gdebiasa earned 200 total points
ID: 1341821
You'll have to put Application.ProcessMessages throughout the process you want to have interrupted. Then, you'll be able to receive an event (like the button click), and set a boolean (StopNow := true, for example).

Then, (I presume you're looping over something, or a similar operation), at the top of the loop, check StopNow and exit the loop/procedure (using break or exit).

The major problem with this is that Application.ProcessMessages will greatly slow down whatever process you're performing (I wouldn't use it more than once per loop, but you might need more, depending on exactly what's happening in your process).

Hope this helps,
Glen
0
 

Author Comment

by:aztec
ID: 1341822
Thanks Glen!

Shawn
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

719 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