Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does _VFP.AutoYield really work?
Message
From
08/02/2000 15:29:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
How does _VFP.AutoYield really work?
Miscellaneous
Thread ID:
00329123
Message ID:
00329123
Views:
129
I've done some testing with the MSComm control and I'm not getting the results I expect. I put code inside the MSComm.OnComm event method to write code to a debugout.txt file:

debugout 'OnComm fired'

I set _VFP.AutoYield to .T. and put code in the click event of a command button to execute a long loop:

debugout 'Click Start'
nStartSeconds = seconds()
for i = 1 to 20000
txtSeconds.value = seconds() - nStartSeconds
txtSeconds.refresh()
endfor
debugout 'Click End'

When I clicked the command button I expected 'OnComm fired' to show up between 'Click Start' and 'Click End' but it didn't. I thought that with AutoYield set to .T. that VFP evaluated events after each line of code. Is this only true of Windows events such as click or does it hold for ActiveX events as well.

When I put a 'doevents' inside the loop that executed every 100th cycle I got the same results. The 'doevents' didn't have any effect until I set AutoYield to .F. I then got the expected behavior.

Does anyone know how events are really processed by VFP?

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform