Syntax |
DoEvents |
Description |
Yields control to other applications. |
Comments |
This statement yields control to the operating system, allowing other applications to process mouse, keyboard, and other messages. If a SendKeys statement is active, this statement waits until all the keys in the queue have been processed. |
Examples |
This first example shows a script that takes a long time and hogs the system. The following routine explicitly yields to allow other applications to execute and refresh on a regular basis. Sub Main() Open "test.txt" For Output As
#1 |
|
In this second example, the DoEvents statement is used to wait until the queue has been completely flushed. Sub Main() id =
Shell("notepad.exe",3) 'Start new instance of
Notepad. |
See Also |
DoEvents (statement). |
D |