collection



My memory is not working well, nor apparently is my ability to find
something simple in the help. I have a bit of code that I inherited. I need
to replace the reliance on handling an error and check for the existence of
the item in the collection directly.

I would like to iterate through the collection and determine the value of
the *key*. I see how to get the item, but with Add, Item and Remove being
the only methods... How can I iterate through the items in a collection and
retrieve the key?

Thanks.


On Error Resume Next

' First, see if anything is there. We can't just access the member of
the
' collection and assign it to a variable, because we don't know what
type of
' variable is in the collection, so we just do a VarType() on it.
eVarType = VarType(oCollection.Item(sKey))
If Err.Number = 0 Then
' It's in there.
bRetVal = True
Else
' It's not in there.
bRetVal = False
End If



.



Relevant Pages

  • Re: collection
    ... > My memory is not working well, nor apparently is my ability to find ... How can I iterate through the items in a collection ... There's nothing built in that would allow this.... ...
    (microsoft.public.vb.general.discussion)
  • Re: The annotated annotated annotated C standard part 3
    ... Beautiful Code, written in 1990, for memory allocation) is destroyed ... When the ability to use language is so checked by the ... You could avoid a problem I understand exists in malloc(), ... the caller to pass an instance of this struct. ...
    (comp.programming)
  • Re: P5B with 4GB uner Win XP 32 Pro - possible to use
    ... I bought an Asus P5B, but using Win XP 32 Pro, I can only use 3 GB. ... memory with a 32 bit OS, ... This is called 'PAE'. ... XP32,happily supports 'PAE', but the ability to use this to handle ...
    (alt.comp.periphs.mainboard.asus)
  • Re: P5B with 4GB uner Win XP 32 Pro - possible to use
    ... I bought an Asus P5B, but using Win XP 32 Pro, I can only use 3 GB. ... memory with a 32 bit OS, ... This is called 'PAE'. ... XP32,happily supports 'PAE', but the ability to use this to handle ...
    (alt.comp.periphs.mainboard.asus)
  • Re: P5B with 4GB uner Win XP 32 Pro - possible to use
    ... I bought an Asus P5B, but using Win XP 32 Pro, I can only use 3 GB. ... memory with a 32 bit OS, ... This is called 'PAE'. ... XP32,happily supports 'PAE', but the ability to use this to handle ...
    (alt.comp.periphs.mainboard.asus)