Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

How to improve this

$
0
0
Code:

Private Sub Timer1_Timer()
 On Error Resume Next
 Static HH As Single
 Static MM As Single
 Static SS As Single
 Static TS As Single
 Static TSS As Single

 TS = TS + 1
 
 TSS = TS / 10
 
 If TSS = ".9" Then
  TS = 0
  SS = SS + 1
 
  If SS = "59" Then
    SS = 0
    MM = MM + 1
   
    If MM = "59" Then
      MM = 0
      HH = HH + 1
    End If
  End If
 End If
 
 Label5.Caption = Right("00" & HH, 2) & ":" & _
                  Right("00" & MM, 2) & ":" & _
                  Right("00" & SS, 2) & ":" & _
                  Right("00" & TS, 2)
 
End Sub


Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>