VBA Collection Manipulation

Discussion in 'AutoCAD' started by Dale Levesque, Feb 20, 2004.

  1. Does anyone know of a resource for code to manipulate the VBA collection
    object. It has been pointed out to me by Tony T. that there are advantages
    to using the old array approach so I'd much rather go that way in this new
    project I'm starting. I'd like to sort the collection by data type and then
    by value. I would also like to compare two collections. Since the collection
    object in itself is quite simple and seems to be the better option I thought
    I would just check and see If I can possibly keep from reinventing the
    wheel.


    Best regards,

    Dale
     
    Dale Levesque, Feb 20, 2004
    #1
  2. Dale Levesque

    wivory Guest

    Collections have their own drawbacks which make sorting them not as straightforward as you might think. However this link does cover the issues and provide some code for getting probably what you want.

    http://www.vbrad.com/pf.asp?p=source/src_sortcollection.htm

    In general, go to Google and type in quotes "sort a collection" for a variety of discussions on the topic.

    Another facility to consider for your storage technique is Dictionaries (the VB-type, not the AutoCAD-type).

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Feb 23, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.