新手求助,程序出现 byref 参数类型问题
Private Sub Form_click()Dim a As String
Dim i As Integer
Dim kk As Integer
Dim j As Double
Dim he!
Dim v1!, v2!, v3!
Dim z!(), v!()
For i = 2 To sum1 - 1 Step 1
For j = 160 To minlever Step -buchang
kk = (160 - j) / buchang
Debug.Print i
v1 = cha(z(), v(), ht(i - 1))
v2 = cha(z(), v(), j)
v3 = cha(z(), v(), ht(i + 1))
模块程序如下
Function cha!(x!, y!, a#)
Dim zhi As String
n = UBound(x)
If x(1) >= a Then
zhi = y(1)
ElseIf x(n) < a Then
zhi = y(n)
Else
For i = 1 To n
If x(i) > a Or x(i) = a Then
ml = i
Exit For
End If
Next i
zhi = y(ml - 1) + (y(ml) - y(ml - 1)) * (a - x(ml - 1)) / (x(ml) - x(ml - 1))
End If
cha = zhi
End Function
由于程序太多行就截取了部分程序,运行显示函数cha(z(), v(), ht(i - 1))中出现了byref参数不符的错误,求助大神解答啊,新手感觉没定义错误啊
问题.zip
(5.02 KB)