Hi!
DOEVENTS command is fixed in VFP7, so it no longer slow down the lengthy processes. In addition, there is a workaround with mouse movements. For example, you can use a program that I recently posted into the FAQ#8149, called "HideToolTip". It moves mouse out of the control and back with no really visible effects and no any side events except MouseMoves. DOEVENTS work quickly in VFP6 when there are MouseMove events in the events queue. This could be used also to speed up the DOEVENTS, instead of the public workaround posted to MS site (with MOUSE command that always cause a mouse click).
>>Hi!
>>
>>Put in the loop the DOEVENTS command. This will force firing of all events, include button clicks and ON KEY commands. ON KEY commands will interrupt the program without DOEVENTS only if _VFP.AutoYield = .T., that is why you get it work not always. Though I recommend to show a "Cancel" button on the form during the process and use DOEVENTS in the loop, so user can press on the Cancel button to interrupt the long process.
>
>Vlad, I find it great that you are back on the forum.
>
>This is great information for me: I didn't know it was at all possible to react to button clicks (for Cancelling) while doing a long operation. I just tried it, and it worked great. Previously, I used inkey(), and told users to use a certain key if they wanted to interrupt the process.
>
>However, I did notice in my tests that DoEvents takes quite a while. Therefore, for tight loops, it might be useful to do something like this (supposing you process records):
>
>
>if recno() % 100 = 0
> DoEvents
>endif
>
>
>Hilmar.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.