Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper cleanup
Message
 
 
To
14/02/2002 11:58:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00620112
Message ID:
00620150
Views:
16
>>Hi everybody,
>>
>>Here is a problem:
>>
>>Class (or program) does some long process (Excel automation), but does not use any VFP specific loop construction. This class (program) shows an animation (using animation class), so user can at least be enterteined by this. However, some users (which are impatient, as I'm) could be tired of waitng and want to stop this long process right away. So, the problem is: how can we stop the process and return control to the main program, which invoked this long process program?
>>
>>What could be your ideas?
>>
>>Thanks a lot in advance.
>
>Nadya,
>
>would this work for you ?
>
>
>local sEscape, sOnEscape
>private Escaped
>Escaped = FALSE
>sEscape = Set('Escape')
>sOnEscape = On('Escape')
>on escape escaped = TRUE
>set escape On
>
>&& long process loop, may be a call to any function or procedure, which cleans up the animation
>
>if( Escaped )
>   && interrupted
>endif
>
>
>on escape &sOnEscape
>set escape &sEscape
>
Hi Gregory,

Great minds think alike :) I was thinking exactly the same and implemented it, but here is a problem: since the calling program (class) doesn't use any loop constructions, you would need to wrap every single command with this statement, which is no good. I don't like timer's idea here, but I currently don't see other possibilities...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform