Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VBScript arrays

  • 15-05-2001 2:08pm
    #1
    Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭


    I'm calling a method in a COM Interface that returns a safearray, from an ASP page. VB sees this as type Object but treats it like a normal array. The problem is in VBScript this doesn't happen.

    Here's the Code:
    [code]
    <%
    dim msgMgr
    dim objXIRMsg()

    set msgMgr=server.createobject("XIRLib.XIRMessageManager")
    '// Call that returns the safearray
    objXIRMsg = msgMgr.getMessages
    %>

    Right, so in Visual Basic this would work but in VBSCript it throws a Type Mismatch error (error number 800a000d). If I include the paranthesis I get a subscript out of range error, obviously.

    The return type of the called method has to be safearray as it's coded in Java. (This is being done as customers have asked for a COM interface to our software)

    Am I doing this wrong or is there another way of doing this?


Comments

  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    Hmmmm if its an array you should be fine by just doing something like the below
    &lt;%
      dim msgMgr
      dim vXIRMsg 'note leave off the ()
      ..
      ..
      vXIRMsg = msgMgr.getMessages
    
    %&gt;
    
    

    we use variants a good bit and we use them for arrays or single values. I can't see why it wouldn't work for you.

    kayos


    When you get to hell tell them I sent you,
    you'll get a group discount...

    tribes.gameshop.ie


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    That worked, thanks Kayos.


  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    Hmmm though so ahhhh I am the master of VB muppets biggrin.gif

    kayos

    When you get to hell tell them I sent you,
    you'll get a group discount...

    tribes.gameshop.ie


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Okay then Kayos, what's the answer to http://www.boards.ie/bulletin/Forum19/HTML/000181.html ?
    I think I have it BTW, but want to test it before I post the solution.


Advertisement