DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Collections in ASP: part II

  1. #1
    Ryan Guest

    Collections in ASP: part II


    So I went through all my books and such and found that it is recommended that
    Dictionary objects are used in place of Collection Objects since Collections
    aren't valid data types in VBScript. BUT, Dictionary object aren't ordered.
    So how in the world do you guys pass higher level variables? Do I have to
    create my own object class that looks and acts like a Collection and rewrite
    my COM Object for that since as far as I know arrays can't be passed as parameters
    in VB? Seems like a waste.

    Has anyone out there tried passing more complex data structures from ASP
    to a COM Object (written in VB6)? I would be very appreciative of any ideas
    that would lead me to overcoming this hurdle.

    Thanks
    ryan

  2. #2
    Gary Guest

    Re: Collections in ASP: part II


    "Ryan" <parnell@iname.com> wrote:
    >
    >So I went through all my books and such and found that it is recommended

    that
    >Dictionary objects are used in place of Collection Objects since Collections
    >aren't valid data types in VBScript. BUT, Dictionary object aren't ordered.
    >So how in the world do you guys pass higher level variables? Do I have to
    >create my own object class that looks and acts like a Collection and rewrite
    >my COM Object for that since as far as I know arrays can't be passed as

    parameters
    >in VB? Seems like a waste.
    >
    >Has anyone out there tried passing more complex data structures from ASP
    >to a COM Object (written in VB6)? I would be very appreciative of any ideas
    >that would lead me to overcoming this hurdle.
    >
    >Thanks
    >ryan


    I've had these challenges before. Instead of passing the collection or array
    between your ASP and COM objects, simply include in your COM interface a
    method to add an item that takes a parameter (ie. String). The ASP should
    not have any knowledge of the container class you are using, or if you are
    even using a container. It's all in the design. For example:

    for class foo, add a method called:

    sub public add(byVal value as String)
    collectiontype.add value
    end sub

    where collectiontype is the type you want to use. Have you tried Flexbag
    as a collection object? Also, you could use XML as the value coming into
    your COM object, parse it in the COM object and store it in the collection.

    Hope this helps.
    Gary


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center