Sub Button1_Click
Log("call sub")
wait for (testSubWithSleep) complete (Result As Boolean)
Log("returned from sub")
End Sub
Sub Button2_Click
Log("call sub")
wait for (testSubWithSleep) complete
Log("returned from sub")
End Sub
Sub testSubWithSleep As ResumableSub
For i=1 To 10
Log(i)
Sleep(300)
Next
Return True
End Sub