Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up DoEvents()
Message
From
01/10/1998 18:07:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00142550
Message ID:
00143058
Views:
30
>David,
>
>
* FastDoEvents.prg 30-Sep-98
>
>* this workaround speeds up a DoEvent call
>
>local lnRow, lnCol, lcWindow
>
>lcWindow = wontop()
>lnRow = mrow( lcWindow )
>lnCol = mcol( lcWindow )
>if ( lnRow > 0 ) and ( lnCol > 0 )
>   * mouse still within VFP window, so it's ok to mouse
>   mouse at mrow(), mcol() window (lcWindow)
>endif
>
>DoEvents()
>
>This is what I worked up after posting the FAQ yesterday and having a TopLevel form app pulling the mouse back inside VFP from other windows. I've got a complex form (100 containers each with 5 objects inside) that gets refreshed every ten seconds it takes on the order of 1.5 seconds to refresh the form. A couple of the objects do a DoEvents() in their Refrsh() in order to catch mouse events that may occur during the Form.Refresh().
>
>I've got test code in the form that times 2 refreshs. Using the above FastDoEvents() shaves a second off the test time and also makes it take a more predictable time. Without the MOUSE command it takes an average of 3.956 with a range of 3.571 to 4.140 seconds. With the MOUSE command it takes an average of 2.953 with a range of 2.872 to 3.082 seconds.
>
>So if you come up with any improvements/fixes to the above code I'd appreciate hearing about them.

Thanks Frank, that's interesting stuff.
I'll give it a go - I've got another app similar to your's by the sound of it (it's a phone call center monitoring/management/modelling system) with lots of containers and object - so it will be a good test.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform