Yields execution to Windows for processing operating system events.
DoEvents
DoEvents does not return until Windows has finished processing all events in the queue and all keys sent by SendKeys statement..
DoEvents should not be used if other tasks can interact with the running program in unforeseen ways. Since the IBM CognosScript editor yields control to the operating system at regular intervals, DoEvents should only be used to force the IBM CognosScript editor to allow other applications to run at a known point in the program.
This example activates the Windows Phone Dialer application, dials the number and then allows the operating system to process events.
Sub main
Dim phonenumber, msgtext
Dim x
phonenumber=InputBox("Type telephone number:")
x=Shell("Dialer.exe",1)
For i = 1 to 5
DoEvents
Next i
AppActivate "Phone Dialer"
SendKeys phonenumber & "{Enter}",1
msgtext="Dialing..."
MsgBox msgtext
DoEvents
End Sub