In Help, the Dialog DoEvents and Sleep topics, is this text:
But both also have this:
These seem slightly at odds. If there are other processes, then doesn't "...continues immediately" let "...other processes to continue", rather than continuing immediately?
So does Sleep 0 immediately start the thread when there are no other threads of equal priority, or does it instead yield time slice to any existing processes.
But then there's this:
If I tried to guess what is meant, this would be my guess:
Sleep 0 - yields to threads only
Sleep <not 0> - yields to threads and processes
And finally, Dialog DoEvents help topic says this:
It says nothing about using Dialog DoEvents in a MODAL dialog. However, I've used, and seen used, Dialog DoEvents in MODAL dialogs. But from reading Help, one would first guess that it is not to be used for MODAL dialogs. Zale once stated that if Help doesn't say you can do it, DON'T - but I've been breaking that rule.
None of this has kept me from using the statements, but it would seem that my use and the documentation may not be in sync.
If m& is zero, the remainder of the current time-slice is relinquished. If there are no other threads of equal priority, execution continues immediately.
allowing other processes (or threads) to continue.
So does Sleep 0 immediately start the thread when there are no other threads of equal priority, or does it instead yield time slice to any existing processes.
But then there's this:
During the SLEEP period, all time-slices for the current thread are given to other threads and processes.
Sleep 0 - yields to threads only
Sleep <not 0> - yields to threads and processes
And finally, Dialog DoEvents help topic says this:
It says nothing about using Dialog DoEvents in a MODAL dialog. However, I've used, and seen used, Dialog DoEvents in MODAL dialogs. But from reading Help, one would first guess that it is not to be used for MODAL dialogs. Zale once stated that if Help doesn't say you can do it, DON'T - but I've been breaking that rule.
None of this has kept me from using the statements, but it would seem that my use and the documentation may not be in sync.
Comment