VB6.0中编写打字速度测试软件出现Over flow
然后运行EXE然后显示溢出这是怎么回事呢DimdtmbegintimeAsDate,dtmendtimeAsDatePrivateSubcmdend_Click()Dim...
然后运行EXE
然后显示溢出
这是怎么回事呢
Dim dtmbegintime As Date, dtmendtime As Date
Private Sub cmdend_Click()
Dim inttimecost As Integer, intwordcount As Integer
inttimecost = DateDiff("s", dtmbegintime, dtmendtime)
intwordcount = Len(txtinput.Text)
txtspeed.Text = intwordwordcount / (inttimecost / 60)
End Sub
Private Sub cmdstart_Click()
dtmbegintime = Time()
End Sub 展开
然后显示溢出
这是怎么回事呢
Dim dtmbegintime As Date, dtmendtime As Date
Private Sub cmdend_Click()
Dim inttimecost As Integer, intwordcount As Integer
inttimecost = DateDiff("s", dtmbegintime, dtmendtime)
intwordcount = Len(txtinput.Text)
txtspeed.Text = intwordwordcount / (inttimecost / 60)
End Sub
Private Sub cmdstart_Click()
dtmbegintime = Time()
End Sub 展开
1个回答
展开全部
错误不少,修正如下
Dim dtmbegintime As Date, dtmendtime As Date
Private Sub cmdend_Click()
Dim inttimecost As Long, intwordcount As Integer
dtmendtime = Time
inttimecost = DateDiff("s", dtmbegintime, dtmendtime)
intwordcount = Len(txtinput.Text)
txtspeed.Text = intwordcount / inttimecost
End Sub
Private Sub cmdstart_Click()
dtmbegintime = Time
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询