com variant bstr array 
Author Message
 com variant bstr array

Hello,

I have a COM object that returns a variant bstr array.
The array has 0-5 elements...

In VBScript:

ccys=wssrpc.GetCurrencies("DIV47")

 MsgBox TypeName(ccys)
 MsgBox TypeName(ccys(1))

The first type name produces String() as expected.
The second throws a type mistmatch error.

Why is this? I tried it in VB and it worked OK? Am I
forced to write this as a pair like this...

num=wssrpc.GetNumCurrencies("DIV47")
for x=0 to num - 1
    MsgBox wssrpc.GetCurrency(x)
next

Thankyou..

Matt



Sun, 30 Sep 2001 03:00:00 GMT  
 com variant bstr array
VBScript only supports arrays of variants -- VBScript is a subset of the VB
language.

Eric


Quote:
> Hello,

> I have a COM object that returns a variant bstr array.
> The array has 0-5 elements...

> In vbscript:

> ccys=wssrpc.GetCurrencies("DIV47")

>  MsgBox TypeName(ccys)
>  MsgBox TypeName(ccys(1))

> The first type name produces String() as expected.
> The second throws a type mistmatch error.

> Why is this? I tried it in VB and it worked OK? Am I
> forced to write this as a pair like this...

> num=wssrpc.GetNumCurrencies("DIV47")
> for x=0 to num - 1
>     MsgBox wssrpc.GetCurrency(x)
> next

> Thankyou..

> Matt



Sun, 30 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. C++ ActiveX Property returns VARIANT Array of BSTR for VBScript or JavaScript

2. C++ ActiveX Property returns VARIANT Array of BSTR for VBScript or JavaScript

3. converting Array to Variant and Variant to Array

4. Array to Variant and Variant to array problem

5. returning empty variant array from COM object?

6. JavaScript access variant array returned by COM object?

7. call to COM object returns empty variant array???

8. Type Mismatch returning variant array from COM object

9. Pass Variant Array to a COM Object

10. Passing VARIANT array to COM

11. Com+ returns variant array, but

12. Passing Variant Array from ASP to COM Component

 

 
Powered by phpBB® Forum Software