dcsimg
abort a method
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ivn_Tcakov
Posted On:   Wednesday, March 9, 2005 03:54 PM

Hello, I was wondering if anyone knows how I can abort a method that is runing and taking too long to finish. I need to do it so that a user can abort it by pushing on a button in a pop-up window. So, how do I actually get into that method and make it stop? The long loops inside the method are usually stopped by calling 'break' but that is inside of the method. I need to do it from "outside". One thing I tried was to have a global boolean value called 'abort' that is set to false and then in the loops of the method I check for its value. So when the user presses the abort button, I make the boolean value true, hoping that then the loops would start 'seing' it as false and break. It didn't happen... I guess the method just had to f   More>>

Hello,
I was wondering if anyone knows how I can abort a method that is runing and taking too long to finish.
I need to do it so that a user can abort it by pushing on a button in a pop-up window. So, how do I actually get into that method and make it stop? The long loops inside the method are usually stopped by calling 'break' but that is inside of the method. I need to do it from "outside".
One thing I tried was to have a global boolean value called 'abort' that is set to false and then in the loops of the method I check for its value. So when the user presses the abort button, I make the boolean value true, hoping that then the loops would start 'seing' it as false and break. It didn't happen... I guess the method just had to finish before any values that are called outside of it can change.

Any suggestions or comments?
I would greately appreciate help.
Thanks
Ivan

   <<Less
About | Sitemap | Contact