retrieve key from collection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Albert

    #1

    retrieve key from collection

    Hello,

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

    Thanks,

    Albert


  • tomb

    #2
    Re: retrieve key from collection

    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:
    [color=blue]
    >Hello,
    >
    >can anyone tell me how i retrieve the key(which i included by adding
    >elements) from an item in the collection?
    >
    >Thanks,
    >
    >Albert
    >
    >
    >
    >[/color]

    Comment

    • gene kelley

      #3
      Re: retrieve key from collection

      On Mon, 19 Jun 2006 14:53:26 +0200, "Albert" <albert@informa nt.nl>
      wrote:
      [color=blue]
      >Hello,
      >
      >can anyone tell me how i retrieve the key(which i included by adding
      >elements) from an item in the collection?
      >
      >Thanks,
      >
      >Albert
      >[/color]

      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

      Comment

      • Brian Gideon

        #4
        Re: retrieve key from collection

        Albert,

        Can you clarify which collection class you're using?

        Brian

        Albert wrote:[color=blue]
        > Hello,
        >
        > can anyone tell me how i retrieve the key(which i included by adding
        > elements) from an item in the collection?
        >
        > Thanks,
        >
        > Albert[/color]

        Comment

        • ronchese

          #5
          Re: retrieve key from collection

          If you use Generic.Sorted list or like, do it:

          Dim strKey As String = colCollection.K eys(Index).ToSt ring

          []s
          Cesar


          "Albert" <albert@informa nt.nl> wrote in message
          news:44969e46$0 $2014$ba620dc5@ text.nova.plane t.nl...[color=blue]
          > Hello,
          >
          > can anyone tell me how i retrieve the key(which i included by adding
          > elements) from an item in the collection?
          >
          > Thanks,
          >
          > Albert
          >[/color]


          Comment

          Working...