Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Use : Sleep 5000
________________________________________________
Public Function Wait(WaitTime)
Dim StartTime As Double
StartTime = Timer
Do While Timer < StartTime + WaitTime
If Timer > 86395 Or Timer = 0 Then Exit Do
DoEvents
Loop
End Function
Use : wait 5
โค้ด Function นี้ก็ไม่มีอะไรมากครับ เหมือนเป็นการหน่วงเวลาในตัวอย่าง 5000 คือ 5 วินาที ใช้ได้ทั้ง 2 แบบนะครับ
ขอบคุณพี่ Jae สำหรับ Function Wait : )
ไม่มีความคิดเห็น:
แสดงความคิดเห็น