by Kris Linville (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 3rd May 2003
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
I found a "bug" in my code for my binary clock that I submitted. When the time reaches 1:00 PM, the minutes section of the clock stop
hour = Format(Time, "h")
If hour < 10 Then
minute = Mid(Time, 3, 2)
Else
minute = Mid(Time, 4, 2)
End If
second = Format(Time, "s")
Replace that section with the following section of corrected:
hour = Format(Time, "h")
If hour < 10 or hour > 12 Then
minute = Mid(Time, 3, 2)
Else
minute = Mid(Time, 4, 2)
End If
second = Format(Time, "s")
If you fancy some trial and error, this section of code could also be redone using LEN instead of < and >.
No comments have been posted about I found a bug in my code for my binary clock that I submitted. When the time reaches 1:00 PM, the. Why not be the first to post a comment about I found a bug in my code for my binary clock that I submitted. When the time reaches 1:00 PM, the.