Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up DoEvents()
Message
De
01/10/1998 09:50:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00142550
Message ID:
00142794
Vues:
28
Also, try dragging a column in a grid from one position to another in a browse or a large grid at run time. Moving the mouse off the screen to keep dragging males for slow moving, but jiggling the mouse up and down expedites things nicely. I wouldn't have thought that programmatic mouse command would have an effect though.


>This is a general issue in VFP, no only with DoEvents(). For example, if you put a spinner on a form and click the up button, increasing the value is relatively slow. If you slightly move the mouse on the button, it suddenly speeds up.
>
>Christof
>
>
>>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.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform