Recovering arrays inside variants!?

Results 1 to 2 of 2

Thread: Recovering arrays inside variants!?

  1. #1
    Join Date
    Dec 1969

    Default Recovering arrays inside variants!?

    I have a component having a member that returns a VARIANT containing an array. It works fine with VB programs and I wanted to use it on the server side of an asp page. Here is a simplified VBScript sub:<BR><BR>sub GetMyArray()<BR>dim mycomp<BR>set mycomp = Server.CreateObject("MyComp.Document")<BR>dim strArray<BR>strArray = mycomp.GetMyArray()<BR>Response.Write(strArray(0)) <BR>end sub<BR><BR>The array contains strings. When I try to open the asp page I get a run time error from VBScript: "Type Mismatch", on the line containing strArray(0).<BR><BR>A very similar sub in a VB program works fine.<BR><BR>Is there any way of getting the elements of the array returned from "mycomp" inside a variant?<BR>

  2. #2
    Steve Cimino Guest

    Default RE: Recovering arrays inside variants!?

    Yeah, this is a known bug (at least I&#039;ve ran into half a dozen times)<BR><BR>In your VB COM object, how are you declaring the array???<BR><BR>DO NOT do this:<BR><BR>Dim myArray(10) As String<BR><BR>instead<BR><BR>Dim myArray(10)<BR><BR>For some odd reason, you cannot type the array when you return it back to ASP.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts