Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to interrupt long loop with mouse click?
Message
From
13/03/2009 14:59:25
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01387703
Message ID:
01387858
Views:
52
>>>>
>>>>Actually, I tried it with DOEVENTS and it works for me, i.e. I can click 'Cancel' button and kill the loop by resetting in Click event some form property evaluated for EXIT within the loop.
>>>
>>>This is exactly what I was trying to do but I could not get the Click event fire. Maybe there is another property that I have to look into. I will keep trying a couple of more approached suggested in the thread.
>>
>>No, I tried brand new form, no special properties were involved. I just noticed that adding RELEASE THISFORM in Click does not work, i.e. form still wants to finish looping before closing; but if I put Thisform.Loopexit=.T. and 'loopexit' property is evaluated in the loop to EXIT then it works..
>
>Where did you put your loop code? Maybe I should have said it in the initial message. But long loop code is in the Activate method of the form. That is, as soon as the form shows, the loop code starts. The form also has a button where in the Click() method I put code THISFORM.lCancel = .T. But my loop that has DO WHILE NOT THISFORM.lCancel never stops.
>
>How is my case different from what you were doing?

I put it in Form.Activate now (it was in different place) and it still works Ok. Maybe, your loop code is something specific. Try it with 'empty' loop, just DOEVENTS.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform