A simple Wait Function
Ur code waits for X seconds without stopping complete VB like most others (incl. Sleep Api)
Assumes
'Set the API Declaration and the Code into a Module
'to use the function Wait(x) x stands for the amount of seconds to wait
API Declarations
Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
Rate A simple Wait Function
(10(10 Vote))
Public Function Wait(ByVal TimeToWait As Long) 'Time in seconds
Dim EndTime As Long
EndTime = GetTickCount + TimeToWait * 1000 '* 1000 Cause u give seconds and GetTickCount uses Milliseconds
Do Until GetTickCount > EndTime
DoEvents
Loop
End Function
A simple Wait Function Comments
No comments yet — be the first to post one!
Post a Comment