Solved

Stopping Processing...

Posted on 1998-10-05
3
127 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 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mobile Keyboard covers the display of the TMemo 3 115
Delphi inherited method 6 89
MS Access from Delphi 31 106
Problem working with dynamic array - help 2 49
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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