Give user ability to interrupt loop.
Give user ability to interrupt loop.
Rate Give user ability to interrupt loop.
(2(2 Vote))
' ------------------------------------------------------------
' Copyright ©2001 Mike G --> IvbNET.COM
' All Rights Reserved, http://www.ivbnet.com
' EMAIL : [email protected]
' ------------------------------------------------------------
' You are free to use this code within your own applications,
' but you are forbidden from selling or distributing this
' source code without prior written consent.
' ------------------------------------------------------------
Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As Long) As Integer
'//ESCAPE
Const VK_ESCAPE = &H1B
'//Button Click
Const VK_LBUTTON = &H1
'//Interrupting A Do Loop
'//Give user ability to interrupt loop
Private Sub cmdStart_Click()
Do
If GetAsyncKeyState(VK_ESCAPE) < 0 Or _
GetAsyncKeyState(VK_LBUTTON) < 0 Then
Debug.Print "-------> EXIT <-------"
Exit Do
End If
Debug.Print "______ LOOPING ___________"
Loop
End Sub
Give user ability to interrupt loop. Comments
No comments yet — be the first to post one!
Post a Comment