| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5600 人关注过本帖
标题:[求助]Run-time error 6':overflow解决方法?
只看楼主 加入收藏
sdrichie
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-5-11
收藏
 问题点数:0 回复次数:3 
[求助]Run-time error 6':overflow解决方法?

我做了VB软件,可惜在运行过程中出现Run-time error 6':overflow这个
不是是什么意思?
望各位高手帮帮忙
工程如下:


Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer

If Val(txtnumber.Text) > 49 Or Val(txtnumber.Text) < 1 Then
MsgBox "输入数值要在1--49内"
Else
i = Val(txtnumber.Text) - 1
Text1(i).Text = Str(Val(Text1(i).Text) + Val(txtcoin.Text))

txtvalue = ""
Dim sum As Double
sum = 0

For j = 0 To 48
sum = sum + Val(Text1(j).Text)
Next j
txtvalue.Text = Str(sum)
End If
'Command1.Enabled = False

End Sub

Private Sub Command2_Click()
txtnumber.Text = ""
txtcoin.Text = ""
End Sub

Private Sub Command3_Click()

Dim i As Integer
Dim j As Integer
Dim sum As Long
Dim total As Long
sum = 0
total = 0

For i = 0 To 48
Label3(i).Caption = ""
Next

For i = 0 To 48
If Val(Text1(i).Text) > Val(txtresult.Text) Then

Label3(i).Caption = Str(Val(Text1(i).Text) - Val(txtresult.Text)) / 2
Text1(i).Text = txtresult.Text
Text1(i).ForeColor = QBColor(12)
End If
Next


For j = 0 To 48
sum = sum + Val(Label3(j))
Next
Txtyue.Text = Str(Val(Txtyue.Text) + sum)

For i = 0 To 48
total = total + Val(Text1(i))
Next
txtvalue = Str(total)

End Sub

Private Sub Form_Activate()
txtnumber.SetFocus
End Sub

Private Sub Form_Load()
If txtnumber.Text = "" And txtcoin = "" Then
Command1.Enabled = False
Command2.Enabled = False
Else
End If
Dim j As Integer

For j = 0 To 48
Text1(j).Text = ""
Next j

End Sub

Private Sub Label11_Click()

End Sub

Private Sub txtcoin_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1_Click
txtnumber.Text = ""
txtcoin.Text = ""
txtnumber.SetFocus
End If

End Sub

Private Sub txtnumber_Change()
Command1.Enabled = True
Command2.Enabled = True

End Sub

Private Sub txtnumber_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtcoin.SetFocus
End If
End Sub

Private Sub txtresult_Change()
If txtresult.Text <> "" Then
Command3.Enabled = True
Else
Command3.Enabled = False
End If
End Sub

搜索更多相关主题的帖子: overflow error 
2006-05-11 20:44
zzwujunqiu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-7-9
收藏
得分:0 
hui
应是内存溢出的意思。
2006-07-09 12:51
小伟的小伟
Rank: 1
等 级:禁止访问
帖 子:122
专家分:0
注 册:2006-1-25
收藏
得分:0 
溢出错误
2006-07-10 13:46
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 

出错时在那一行?


2006-07-10 14:38
快速回复:[求助]Run-time error 6':overflow解决方法?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036519 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved