Passing Multi-Dimensional arrays to COM objects from VBScript/ASP 
Author Message
 Passing Multi-Dimensional arrays to COM objects from VBScript/ASP

Just recently I discovered that passing an array as a parameter
to a COM object from VBScript results in passing the reference to
the array rather than the value.  Odd as it may seem, this can be
remedied by sending the array to the Array() function.

However, this does not work for multidimensional arrays.  The
COM receives it as an array with an upper and lower bound of
0.  Does anyone know how to properly send multidimensional arrays
as a parameter to a COM object?

Thanks,

-sackeri

-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.*-*-*.com/



Sat, 01 Feb 2003 03:00:00 GMT  
 Passing Multi-Dimensional arrays to COM objects from VBScript/ASP
You can send it by declaring the parameter as a variant and passing it
by reference.

Public Function TestArray(ByRef vntArray as Variant) as Variant
    debug.print vntarray(0,0)
end function

Kirk Allen Evans



Quote:
> Just recently I discovered that passing an array as a parameter
> to a COM object from VBScript results in passing the reference to
> the array rather than the value.  Odd as it may seem, this can be
> remedied by sending the array to the Array() function.

> However, this does not work for multidimensional arrays.  The
> COM receives it as an array with an upper and lower bound of
> 0.  Does anyone know how to properly send multidimensional arrays
> as a parameter to a COM object?

> Thanks,

> -sackeri

> -----------------------------------------------------------

> Got questions?  Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com

--
Kirk Allen Evans

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 01 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sort a multi-dimensional array in VBScript? (ASP)

2. Passing a multi-dimensional (2 dimensions) array of VARIANTS as BOTH input and output from VBScript / ASP page to MFC COM object

3. Passing a multi-dimensional (2 dimensions) array of VARIANTS as BOTH input and output from VBScript / ASP page to MFC COM object

4. Passing a multi-dimensional (2 dimensions) array of VARIANTS as BOTH input and output from VBScript / ASP page to MFC COM object

5. Passing MultiDimensional Array from ASP to VBScript

6. Multi Dimensional Arrays in Jscript (ASP)

7. Returning multi-dimensional arrays from COM component

8. passing a multi dimensional array to vbs

9. Passing an array from an ASP to a COM object

10. Passing an array from an ASP to a COM object

11. Passing an Array from a COM Object to an ASP Page

12. Passing array from COM object to ASP

 

 
Powered by phpBB® Forum Software