-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRide Timer Fighter Two - Module 3.bas
48 lines (48 loc) · 1.39 KB
/
Ride Timer Fighter Two - Module 3.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Public StopIt As Boolean
Public ResetIt As Boolean
Public LastTime
Sub RideTimerTwo_Start()
Dim StartTime, FinishTime, TotalTime, PauseTime
StopIt = FALSE
ResetIt = FALSE
If Range("H8") = 0 Then
StartTime = timer
PauseTime = 0
LastTime = 0
Else
StartTime = 0
PauseTime = timer
End If
StartIt:
DoEvents
If StopIt = TRUE Then
LastTime = TotalTime
Exit Sub
Else
FinishTime = timer
TotalTime = FinishTime - StartTime + LastTime - PauseTime
TTime = TotalTime * 100
HM = TTime Mod 100
TTime = TTime \ 100
hh = TTime \ 3600
TTime = TTime Mod 3600
MM = TTime \ 60
SS = TTime Mod 60
Range("H8").Value = Format(hh, "00") & ":" & Format(MM, "00") & ":" & Format(SS, "00") & "." & Format(HM, "00")
If ResetIt = TRUE Then
Range("H8") = Format(0, "00") & ":" & Format(0, "00") & ":" & Format(0, "00") & "." & Format(0, "00")
LastTime = 0
PauseTime = 0
End
End If
GoTo StartIt
End If
End Sub
Sub RideTimerTwo_Stop()
StopIt = TRUE
End Sub
Sub RideTimerTwo_Reset()
Range("H8").Value = Format(0, "00") & ":" & Format(0, "00") & ":" & Format(0, "00") & "." & Format(0, "00")
LastTime = 0
ResetIt = TRUE
End Sub