Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel Processing

Status
Not open for further replies.

crtillerson

Programmer
Nov 4, 2003
8
0
0
US
I have an application that converts data from one format to another. The interface is very simple - enter input/output paths and filenames then hit the run button. While the user input is basic, there is a lot going on to process the files. Databases connections are established, temp files are created and destroyed, etc. The original input and the final output files can be very large and processing can take some time.

I'd like to create a "Cancel" or a "Stop Processing" button so the user can abort a long run if necessary. I won't know where they are in the processing so I don't know which connections, files, etc. are open and will need to be closed to clean things up before the user starts a new run. Is there a command or function that will automatically close all connections, filestreams, etc. or do I have to walk thru all the possibilities, check their existence, and close each one separately?

Any thoughts?

Thanks!
Clint
 
I don't know if there is a command, but I would have the cancel command button initialize a Stop variable that your processing checks as it's looping through its duties. That way you can decide at what point you will allow processing to be canceled and thereby know the state of your objects at point of cancel... Otherwise, clean up would get pretty messy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top