Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collections Index Number and Idnetifier

Status
Not open for further replies.
Jun 24, 2005
109
GB
Does anybody know of how to return a collection items index number, or identifier?

I just cant seem to work it out!

Matt
 
What about .Index ?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 


Hi,

What are you trying to do? There are usually 99 different ways to accomplish something -- some better than others.

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Perhaps a Scripting.Dictionary object ?
Any chance you could elaborate a little more about WHAT YOU WANT TO DO ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Without going into too much detail!

I have a collection of values, indexed by a string identifier such as "2005 01" (year week). These are populated into the collection at an earlier point in the program.

they are populated like this: collection.add (value,"yr week")

If I am looking for a particular week i can retrieve it using: x = collection("yr week")

At points I loop through the collection using a for each loop eg:

for each x in collection
'this bit here!!!!
next

there is a need for me to know what yr week the current item (or x) is at some points in that loop.

I know that I could use a different type of loop, or rather than just adding values to the collection, add an object, but I was wondering if i was missing something obvious. Like some command that would retrieve either the index string I entered for each value, or the natural index value that exists in all collections.

Sorry if I didn't explain myself fully enough.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top