Solved

Stopping Processing...

Posted on 1998-10-05
3
129 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

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…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

636 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