
02-07-2004, 06:58 AM
|
 |
Junior Contributor
|
|
Join Date: Jan 2004
Location: France
Posts: 292
|
|
Quote: Originally Posted by Wah-Wah Is there a command that makes a pause during a sub?
Like if you say the command in the sub, and you enter a some sord of time value like "1", (one second), it will not go to the next command in line, until 1 second has passed...
You can use the GetTickCount API :
in a Module :
Code:
'API déclare
Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
'WAIT Function
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
In your Sub Code :
Code:
' ...
Wait 1 'Wait for 1 second
' ...
|
|