Reading array values

Results 1 to 2 of 2

Thread: Reading array values

  1. #1
    Dilip Guest

    Default Reading array values

    Hi,<BR><BR>I am getting error "An exception of type &#039;Microsoft VbScript runtime error: Type mismatch&#039; was not handled." at<BR>Response.Write(myarray1(0)) in the below code.<BR><BR>The COM object is returning array values properly. Through Quick View mode in Visual Interdev I can see the values in array myarray1. But I&#039;m not able to read it. Any ideas ?<BR><BR>&#060;%<BR><BR>dim myarray1<BR><BR>set obj = Server.CreateObject("Project1.class1")<BR>myarray1 = obj.process()<BR><BR>Response.Write(myarray1(0)) <BR>%&#062;<BR><BR>Thanks<BR>Dilip

  2. #2
    Join Date
    Dec 1969

    Default Valid return values for scripting..

    WHAT are you returning from that function?<BR><BR>VBS wants you to return a VARIANT that happens to be a SafeArray.<BR><BR>How about doing:<BR><BR>&#060;%<BR>Response.Write "Type number is " & VarType(myarray1) & "&lt;BR"<BR>Response.Write "Type name is " & TypeName(myarray1) & "&lt;BR"<BR>Response.Write "Is it an array? " & isArray(myarray1) & "&#060;HR&#062;"<BR>%&#062;<BR><BR>???

Posting Permissions

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