标题:溢出堆栈空间问题
取消只看楼主
sncelpl
Rank: 1
等 级:新手上路
帖 子:87
专家分:0
注 册:2006-6-28
结帖率:86.67%
已结贴  问题点数:5 回复次数:1 
溢出堆栈空间问题
Dim a As String, b As String, c As String, d As String, e As String, m As String, n As String, Y As String

Function max(a, b)
max = IIf(a > b, a, b)
End Function
Function min(a, b)
min = IIf(a < b, a, b)
End Function
Sub tSum()
a = Val(Text5(4))
b = Val(Text5(5))
c = Val(Text5(6))
m = max(a, max(b, c))
n = min(a, min(b, c))
Static s
If Text5(4) <> "" Then
s = s + 1
End If
If Text5(5) <> "" Then
s = s + 1
End If
If Text5(6) <> "" Then
s = s + 1
End If
If Text5(4).Text = "" And Text5(5).Text = "" And Text5(6).Text = "" Then
Else
Y = (Val(Text5(4)) + Val(Text5(5)) + Val(Text5(6))) / s
s = 0
Text5(7).Text = (m - n) / Y
Text5(7).Text = Format(Text5(7), "0.00%")
End If
a = Val(Text5(0))
b = Val(Text5(1))
c = Val(Text5(2))
m = max(a, max(b, c))
n = min(a, min(b, c))
Static w
If Text5(0) <> "" Then
w = w + 1
End If
If Text5(1) <> "" Then
w = w + 1
End If
If Text5(2) <> "" Then
w = w + 1
End If
If Text5(0).Text = "" And Text5(1).Text = "" And Text5(2).Text = "" Then
Else
Y = (Val(Text5(0)) + Val(Text5(1)) + Val(Text5(2))) / w
w = 0
Text5(3).Text = (m - n) / Y
Text5(3).Text = Format(Text5(3), "0.00%")
End If
End Sub

Private Sub Text5_Change(Index As Integer)
Call tSum
End Sub
运行填数后要报"溢出堆栈空间"
那位老大帮我看下要怎么改
搜索更多相关主题的帖子: Text Then String End If 
2022-05-18 11:52
sncelpl
Rank: 1
等 级:新手上路
帖 子:87
专家分:0
注 册:2006-6-28
得分:0 
回复 3楼 风吹过b
不加调用就不自动计算啊
不用数组不会报错。
如能单个写Private Sub Text5_Change(Index As Integer)应该可以
怎么这样写我就不会了Private Sub Text5(0)_Change(Index As Integer)

[此贴子已经被作者于2022-5-18 18:09编辑过]

2022-05-18 18:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-509110-1-1.html




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

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