|
-
May 31st, 2002, 09:19 PM
#1
Thread Starter
Lively Member
Why wont it stop
Why wont my timer turn off after it hits 5 seconds:
Private Sub ShrapTime_Timer()
Dim T As Integer
T = Second(Now) Mod 5
If T = 1 Or 2 Or 3 Or 4 Then
MoveShrap
ElseIf T = 5 Then
ShrapTime.Enabled = False
End If
End Sub
-
May 31st, 2002, 09:23 PM
#2
Try T => 5 (equal to OR greater than 5)
-
May 31st, 2002, 09:26 PM
#3
Problem here to:
VB Code:
If T = 1 Or 2 Or 3 Or 4 Then
should be:
VB Code:
If T = 1 Or T = 2 Or T= 3 Or T = 4 Then
And......... You prolly need atleast MOD 6 too.
-
May 31st, 2002, 09:28 PM
#4
Thread Starter
Lively Member
-
May 31st, 2002, 09:29 PM
#5
Thread Starter
Lively Member
Ah dang "or" stuff... I always mess it up.
Although it still doesnt shut down.
-
May 31st, 2002, 09:31 PM
#6
I successfully tested with this:
VB Code:
Option Explicit
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub timer1_Timer()
Dim T As Integer
T = Second(Now) Mod 6
If T = 1 Or T = 2 Or T = 3 Or T = 4 Then
'MoveShrap
ElseIf T >= 5 Then
MsgBox "Greater Than 5"
'ShrapTime.Enabled = False
End If
End Sub
-
May 31st, 2002, 09:33 PM
#7
And... you can replace that whole T= LINE with:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|