0

Hi!
I expect the next program wait 1 sec. and exit but doesn't work.
Could anybody help me?

Private Sub Command1_Click()
Timer1.Interval = 1000
Timer1.Enabled = True
aaa = 0
lo:
If aaa < 1 Then
GoTo lo
Else
End
End If
End Sub

Private Sub Timer1_Timer()
aaa = 10
End Sub

thx. Sandor

4
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by rstkw
0

What is the Main Objective of the Code?

that is all. I want to controll an equipment via com port and I need to wait some millisec.
Wait rutin I would use more times, more places in main program.
The program only wait some millisec., after that continue.
thanks for your help

0

Use Sleep() API it will freeze ur Application for given milliseconds

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

1000 Milliseconnds = 1 Second

0

Any time you use a timer, put a DoEvents in the loop. The timer object is basically unreliable. There are better substitutes.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.