General information
Category:
ActiveX controls in VFP
Title:
How does _VFP.AutoYield really work?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only