[thelist] Visual Basic 6.0 - Iterating through Collections....

Anthony Baratta Anthony at Baratta.com
Tue Nov 14 18:08:05 CST 2000


Scott Dexter wrote:
> 
> Actually, that gets the Key. One more step and you have it:

Scott...

I found that Collections basically suck. They are NOT dictionary objects when it
comes to getting data out. In fact you *can not* get the index of a collection item!!
Here's a snippet from a book I uncovered:

Visual Basic Language Developer's Handbook
by Ken Getz & Mike Gilbert

"Why is a Dictionary Better than a Collection?"
Page 928

"The dictionary object fixes several of the glaring errors in the design of the VBA
Collection object -- errors that continue even after several versions. Perhaps the
VBA team doesn't see these issues as "errors," but they make the Collection object
difficult, if not impossible to use. In specific,

        ....

    *   You can retrieve **both keys and items** (emphasis mine), given a 
        Dictionary Object. That is, because of the Items and Keys properties,
        you can retrieve items from either array. In a Collection, you can
	**only retrieve the items, not the Key values** (emphasis mine).

        ...."

So in summary... Visual Basic sucks. ;-P I'm off to drown my sorrows with a case of
Dr. Pepper.

(soon to be) Bloatedly yours,

-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami




More information about the thelist mailing list