hexagon logo

Return array from function.

In Basic Script I would like to return an array from a function and cannot figure what I'm doing wrong. I get and unspecified error.

Code sample:

Sub ApplyShift()
Dim TmpVal
TmpVal=DOFTransForm(0,0,0,1,1)
End Sub ' ApplyShift()

Function DOFTransForm(xval As Single, yval As Single, zval As Single, txval As Single, tyval As Single) As Single
Dim ResultArray(2) As Single

ResultArray(0)=txval
ResultArray(1)=tyval

DOFTransForm = ResultArray

End Function ' DOFTransForm

Sub Main()

ApplyShift

End Sub