在SQABasic中如何在Function中返回一个二维的数组?
在SQABasic中如何在Function中返回一个二维的数组。我这样写对不对呢?Function test(…………..) As Variant
dim RobotData () As Variant
redim preserve RobotData (2, 9)
………………
RobotData (0, 1) = rs.field(0).value
test = RobotData(,) ‘还是这样写:test = RobotData? Test = RobotData()?
‘最后两种方式我试了一下都编译不通过
End Function
另外,怎么使用语句来接受这个函数返回的数组呢?谢谢
可以这样使用
Function GetArray( out_RobotData() As Variant, in_iLen As Long) As LongDim i As Long
redim preserve out_RobotData ( in_iLen )
For i = LBound(out_RobotData) To UBound(out_RobotData)
out_RobotData(i) = i
Next i
End Function
Sub Main
Dim lRet As Long
Dim RobotData() As Variant
lRet = GetArray( RobotData, 6 )
End Sub
页:
[1]