定义数组返回值不见得真的返回去呀?
例如:
Public Function ReturnArray(ByVal AryNum As Integer ByRef Ary() as String)
Dim i As Integer
ReDim Ary(AryNum)
For i=0 to AryNum
Ary(i)=CStr(i)
Next i
End Function
这里Ary用的是ByRef按引用方式传递,这样函数内部做的改变等同于在外部做的改变。也就是拿这个函数写个调用上面这个函数的例子
Dim AryNum,i as Integer
AryNum=100
Dim Ary() As String
Call ReturnArray(AryNum,Ary())
For i=0 to AryNum
Print Ary(i)
Next i
这样不就等于把数组返回来了吗?