Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Returning Object Arrays

Hello,

I have (what I believe is) a simple syntax issue wrt returning user-defined object arrays:

Say I have a class clsGx that I am implementing as an array Gx(maxIndices):

And say, after population, I want to pass it to a function that returns another array of clsGx instances (Gx2(maxIndices))as follows

Set Gx2 = exch(Gx)

With exch being defined as follows:

Private Fuction exch(Gx() As clsGx) as clsGx
...
End Function

Currently, I am receiving a compile errors including can't assign to array. Any suggestions?
[595 byte] By [Nai] at [2007-11-11 7:38:48]
# 1 Re: Returning Object Arrays
See if this helps:
http://msdn.microsoft.com/library/en-us/vbcon98/html/vbconadvancedfeaturesofarrays.asp
Phil Weber at 2007-11-11 17:26:43 >
# 2 Re: Returning Object Arrays
you forgot the last couple of parenthesis (the function is returning an array):

Private Fuction exch(Gx() As clsGx) as clsGx()

Marco
mstraf at 2007-11-11 17:27:43 >