Click to See Complete Forum and Search --> : time


December 17th, 1999, 03:18 PM
how do i make it so that my form will pause for a small amount of time?
i have tried the code

Public Sub Time_Timeout(howlong)
current = Timer
Do While Timer - current < Val(howlong)
DoEvents
Loop
End Sub

but it keeps saying current is not defined. How would I define current to timer? Or, how would I make my form pause for a limited amount of tme?

December 17th, 1999, 03:43 PM
Try to add this API function to your code : sleep

sleep (number)
( "number" contain laps time you want to wait, in millisecondes)

PanasonicSubz
December 17th, 1999, 08:58 PM
Ok try this

make 2 forms, make them identicle with a control array, make the first one with everything locked, and put a timer on it. put in for the code:

unload me
form2.show
under the timers code. then the other form will come up, but remember to unlock the second form. well i hope that works

PanasonicSubz

AndyK
December 17th, 1999, 09:08 PM
I have to examples one is with timer second is with API which is more accurate:

Sub Wait(Seconds)

Current = Timer
Do While Timer - Current < Val(Seconds)
DoEvents
Loop
End Sub



and:

private Declare Sub Sleep Lib "kernel32" _
(byval dwMilliseconds as Long)

Sub Wait(Seconds as Single)

Dim lMilliSeconds as Long
lMilliSeconds = Seconds * 1000
Sleep lMilliSeconds

End Sub