初学者调试程序时遇到的一个小问题?请教!
dszch 2004-11-02 01:05:18 我按照书上的例子,调试一个计时器的小程序,基本是通了,但是有一点小问题,请高手帮我解决!谢谢了!
程序如下:
Private Sub Command1_Click()
If Command1.Caption = "&S 暂停" Then
Command1.Caption = "&C 继续"
Timer1.Enabled = False
Else
Command1.Caption = "&S 暂停"
If Label1.Caption = "00:00:00:0" Then Form1.Tag = Timer
Timer1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Form1.Tag = Timer
Label1.Caption = "00:00:00:0"
End Sub
Private Sub Timer1_Timer()
m = Timer - Form1.Tag '调试时说这一句类型不匹配
n0 = (m * 10) Mod 10
m = Int(m)
n1 = Format(m Mod 60, "00.")
n2 = Format((m \ 60) Mod 60, "00:")
n3 = Format(m \ 3600, "00:")
Label1.Caption = n3 & n2 & n1 & n0
End Sub
出现的问题是,一点击开始,出现类型不匹配的提示。
当点击“重置”按钮后,就正常了。
如何解决这个问题?