To all,
I am testing passing an array from a sub to a function which then returns an array.I am having trouble with the indices. The test below doesn't do anything clever. I am only testing passing array()
Thanks
Regards
JXB
'----------------------------------------------
Sub TestingArray()
Dim myvalues()
Dim testarray()
myvalues={0.,0.,0.,0.} ' initialise array
testarray={0.,0.,0.,0.} ' initialise array
'Pass the array testarray() to function ReturnedArray()
'the function ReturnedArray() returns a new array
'which is allocated to array myvalues()
myvalues = ReturnedArray(testarray)
End Sub
Function ReturnedArray(ByRef InputArray() As Object)
Dim myarray() as Double = {10,20,30,40}
ReturnedArray=myarray()
End Function
I am testing passing an array from a sub to a function which then returns an array.I am having trouble with the indices. The test below doesn't do anything clever. I am only testing passing array()
Thanks
Regards
JXB
'----------------------------------------------
Sub TestingArray()
Dim myvalues()
Dim testarray()
myvalues={0.,0.,0.,0.} ' initialise array
testarray={0.,0.,0.,0.} ' initialise array
'Pass the array testarray() to function ReturnedArray()
'the function ReturnedArray() returns a new array
'which is allocated to array myvalues()
myvalues = ReturnedArray(testarray)
End Sub
Function ReturnedArray(ByRef InputArray() As Object)
Dim myarray() as Double = {10,20,30,40}
ReturnedArray=myarray()
End Function