Home All Groups Group Topic Archive Search About

retrieve key from collection

Author
19 Jun 2006 12:53 PM
Albert
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert

Author
19 Jun 2006 3:03 PM
tomb
If the item you are collecting has a way of storing the key, then you
have it.  Otherwise, I've searched all over the collection object - it
isn't there.
The other option you have is to subclass your own collection object and
build in the functionality yourself.

T

Albert wrote:

Show quoteHide quote
>Hello,
>
>can anyone tell me how i retrieve the key(which i included by adding
>elements) from an item in the collection?
>
>Thanks,
>
>Albert
>
>

>
Author
19 Jun 2006 7:57 PM
gene kelley
On Mon, 19 Jun 2006 14:53:26 +0200, "Albert" <alb***@informant.nl>
wrote:

>Hello,
>
>can anyone tell me how i retrieve the key(which i included by adding
>elements) from an item in the collection?
>
>Thanks,
>
>Albert
>

The general collection class does not really offer that funtionality.
If you need to work with both key and item, you likely would want to
use one of the specialized collections.  Which one depends on what you
are wanting to accomplish.

Gene
Author
19 Jun 2006 9:04 PM
Brian Gideon
Albert,

Can you clarify which collection class you're using?

Brian

Albert wrote:
Show quoteHide quote
> Hello,
>
> can anyone tell me how i retrieve the key(which i included by adding
> elements) from an item in the collection?
>
> Thanks,
>
> Albert
Author
20 Jun 2006 4:56 AM
ronchese
If you use Generic.Sorted list or like, do it:

Dim strKey As String = colCollection.Keys(Index).ToString

[]s
Cesar


Show quoteHide quote
"Albert" <alb***@informant.nl> wrote in message
news:44969e46$0$2014$ba620dc5@text.nova.planet.nl...
> Hello,
>
> can anyone tell me how i retrieve the key(which i included by adding
> elements) from an item in the collection?
>
> Thanks,
>
> Albert
>