View a collection item

I have collection object created and i am trying to add an class object to the collection object.
Now after i add the class object i want to view the item added to the collection , how can i do that ?
any comments ..........
I tried print mcol.item(1) or
        mcol.item(1).show   -  but it won't  work
  where  mcol is the collection object.

Thank You
Who is Participating?
strongdConnect With a Mentor Commented:
Here's the way I view item in a collection.  

myitem = mcol.item(1)

when you step through this with the debugger you'll see that myitem will variable will now be item 1 in your collection.  It is just an easy way to see what is in the collection.   If you have more than 1 thing in your collection then use a For-Next loop.
For i = 1 to mcol.count step 1
     myitem = mcol.item(i)
next i

Set your break point at the For i ....etc...   then just step through.   This seems to be the easiest way to see what the order is in the collection.   Also make sure that myitem is defined as what ever is in the collection.   So if you defined or dim the collection as a string, make sure that myitem is dim as string.   Hope this helps.  

KasachAuthor Commented:
Edited text of question.
KasachAuthor Commented:
Thanks Strongd, but my intention was something else..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.