Return VB arrays to JScript (WSC under WSH - I think) 
Author Message
 Return VB arrays to JScript (WSC under WSH - I think)

Hi,

I need to return a 2D array [out] parameter from a VB(6)
COM Object to JScript (that's the language a method on a
Windows Scripting Component has been written in).

I thought that either COM would handle the datatype
conversion or at worse I'd use VBArray() within JScript
however I can't get either to work. Does anyone have any
suggestions?

Cheers,

Mike



Sat, 09 Oct 2004 20:13:29 GMT  
 Return VB arrays to JScript (WSC under WSH - I think)

Quote:
> I thought that either COM would handle the datatype
> conversion or at worse I'd use VBArray() within JScript
> however I can't get either to work. Does anyone have any
> suggestions?

Solution #1

Implement a new method on the VB COM component that returns a serialzed string version of the 2D array that JScript can parse to construct an array or arrays (the closest JScript can come to a 2D array).

Solution #2

Write a VBScript wrapper that serializes the 2D array to a string that JScript can parse (as in solution #1) and call the VBScript wrapper from JScript.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 10 Oct 2004 03:16:27 GMT  
 Return VB arrays to JScript (WSC under WSH - I think)
solution #3 flatten it from 2d to 1d

this is what I do when using recordset.getRows() from JScript.

Atrax - MVP [Microsoft Most Valued Professional]

http://www.infinitemonkeys.ws/

Host with me for $100 a year!
http://www.atrax.ws/hosting/

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 10 Oct 2004 16:14:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. wsh/ jscript : BUG : array of array, 2D array

2. Returning arrays from VB/VC components or VBScript to JavaScript in ASP

3. Using array returned by VB component

4. Returning an array from a VB dll

5. Returning Array of Strings from COM to JScript

6. Returning Variants That Contains an Array to JScript

7. JScript call Java Applet method which return an array

8. VB call to JScript method returns method's source

9. ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it

10. ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it

11. JScript Arrays to VB SafeArrays - YES

12. JScript Arrays to VB SafeArrays - YES

 

 
Powered by phpBB® Forum Software