vb怎么获得返回值为数组的方法结果
public function getArr()
dim arr(0 to 3) as String
arr(0) = "0"
arr(1) = "1"
arr(2) = "2"
arr(3) = "3"
getArr = arr
end function
调用的时候:
Dim x() as String
set x = getArr ' 报错: 不能给数组赋值?
public function getArr() as String()
dim arr(0 to 3) as String
arr(0) = "0"
arr(1) = "1"
arr(2) = "2"
arr(3) = "3"
getArr = arr
end function
Dim x() as String
x = getArr 'set x = getArr ' 不是对象,不用使用set