Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up DoEvents()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00142550
Message ID:
00142762
Views:
32
>This is a copy of a FAQ I just posted:
>
>Calling DoEvents() has always been horribly slow in VFP. While reporting another issue with Hong-Chee Tan at Microsoft he found that moving the mouse around alters the test code I sent him. So this fact gives a workaround to speed DoEvents back up using a MOUSE command. Try this code for example:
>
>
* doevtest.prg
>lparameter llMouse
>
>local x, i
>
>x = seconds()
>
>for i = 1 to 100
>   if ( llMouse )
>      mouse at mrow(), mcol()
>   endif
>   doevents()
>endfor
>
>activate window "debug output"
>debugout seconds() - x
>
>Run it with and without a .t. argument and see the difference in execution times 26 vs 0.5 seconds on a P2-300 Win95 class machine.

Hi David,

This is terrific news. I had a spinning graphic that I was using to indicate that the computer was working when retrieving data from an OLE automation seriver. The DoEvents() made it intolerably slow (had to use it to get the thing to work), so I had to abandon the idea. Maybe now I can use it. Thanks for the info.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform