Re: Create a custom collection
- From: "Carlos J. Quintero [VB MVP]" <carlosq@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 Jan 2006 17:27:11 +0100
Hi Mike,
> Dim md as New MyDictionary
> md.add("Mike", Object1)
> md.add("Mike", Object2)
> This will generate an error during compilation, because I cannot add Mike
> two times to the collection, we all know that.
I suppose that you mean at run-time not a compile-time...
> I need a key (string type, can be duplicate) and a value
Dictionaries use keys and keys, by definition, can not be duplicated.
Otherwise, when you try to retrieve an item by key, which one of the
duplicates you would return?
Maybe you would have to use a dictionary whose objects are collections
(allowing duplicates)...
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com
.
- References:
- Create a custom collection
- From: Mike
- Create a custom collection
- Prev by Date: Create a custom collection
- Next by Date: Re: Capture and redirect TCP traffic
- Previous by thread: Create a custom collection
- Next by thread: Re: Create a custom collection
- Index(es):