View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Functions that return arrays

I don't vouch for "best practice", but if the functions in the freely
downloadable file at http://home.pacbell.net/beban are available to your
workbook, you might consider

Assign identity(tempVector), tempVector

Alan Beban

Pflugs wrote:
. . .
I originally declared these array variables as doubles, but I found I could
not use functions like the following example:

Dim tempMatrix(1 to 3, 1 to 3) as Double
tempVector = identity(tempVector)

where "identity" is a UDF that accepts a square array and sets it to an
identity matrix. I imagine that I cannot assign the function's return to
tempVector because it is a double array, not a Variant (i.e. not an object). . . .