Function sum(N As Integer, m As Integer, p As Integer) As Long
sum() = (s1 + s2) / s3
End Function
Private Sub Command1_Click()
Dim sum() As Integer
N = Text1.Text
m = Text2.Text
p = Text3.Text
s1 = 0
For i = 1 To N
s1 = s1 + i
Next i
s2 = 0
For j = 1 To m
s2 = s2 + j
Next j
s3 = 0
For k = 1 To p
s3 = s3 + k
Next k
Text4.Text = sum(N, m, p)
End Sub
最后提示说下标越界,错在哪啊?怎么改?
能说下如何改吗?