-
July 8th, 2009, 12:56 AM
#1
[RESOLVED] Watching collection data using immediate window
i have made one collection suppliers.and collection to collect all supplier data cSuppliers.i want to
see collection data using immediate window.Can anybody tell me .How should i see collection value using immediate window.any help would be Greatly appreciated.when i type ?m_cEmployees.Item(1) in a immediate window i got error
object does not support this property of method.Kindly find the attachment also.any help would be greatly appreciated.
[code=vb]
?m_cEmployees.Item(1)
[/code]
-
July 8th, 2009, 03:18 AM
#2
Re: Watching collection data using immediate window
Code:
Option Explicit
Private Sub Form_Load()
Dim C As New Collection
C.Add "Test"
End Sub
Code:
?c(1)
Test
?c.Item(1)
Test
Which tells me that you have not initialized your collection.
Good Luck
-
July 8th, 2009, 11:22 AM
#3
Re: Watching collection data using immediate window
Click MANAGE ATTACHMENTS on the bottom of the REPLY page. Browse for your ZIP file, click UPLOAD, then save the message.
-
July 9th, 2009, 12:15 AM
#4
Re: Watching collection data using immediate window
-
July 9th, 2009, 10:14 AM
#5
Re: Watching collection data using immediate window
To understand more of your collection:
What type of items do you add to it? Is it simple strings or are they objects of more complex nature?
-
July 11th, 2009, 12:38 PM
#6
Re: Watching collection data using immediate window
You can't see the whole value of all the members of your collection. This isn't VB.Net, which does have a .ToString method which will return collection data
-
July 17th, 2009, 08:15 AM
#7
Re: Watching collection data using immediate window
Originally Posted by dglienna
You can't see the whole value of all the members of your collection. This isn't VB.Net, which does have a .ToString method which will return collection data
Forget all this discussion. I have already shown him picture by picture how to watch values in a collection how to build up a collection how to read data and all that. But Instead of doing what I told him he wants things which are not usual in VB. For example he wants to see the pointers to the heap and he adresses the items with the internal structure data instead with the real key...
Firoz as already told 100 times or more ( really ) Use
m_cemployees and not m_cemployees.Item(3)
Your Items have Keys like E1, E2,... E155 and the collection class Item property waits for a string which starts with 'E'
And if you want to see the items look into the debugger one item after the other within your collection class
Here in this inner collection ( mCol as Collection ) the items are numbered from one to n logically.
But simple open the items with the + sign and you can watch every single item. Look at the screenshots I did for you and DUPLICATE whats going on.
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
My latest articles :
Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
-
July 17th, 2009, 08:19 AM
#8
Re: Watching collection data using immediate window
Originally Posted by dglienna
You can't see the whole value of all the members of your collection. This isn't VB.Net, which does have a .ToString method which will return collection data
Can't you use the Item property of the collection ¿
ToString is only a Conversion function, nothing special really...
EDIT: Didn't see your post Johann, great post as usual
-
July 17th, 2009, 09:28 AM
#9
-
July 17th, 2009, 07:07 PM
#10
Re: Watching collection data using immediate window
Originally Posted by HanneSThEGreaT
Can't you use the Item property of the collection ¿
ToString is only a Conversion function, nothing special really...
EDIT: Didn't see your post Johann, great post as usual
You can see ONE item in a debug.print statement, but not the whole list, as you can in Net. By .ToString, I meant defining your own string (which could include a loop to show all items)
-
July 18th, 2009, 02:55 AM
#11
Re: Watching collection data using immediate window
I don't understand what you mean David Mind showing an example of what you mean, because I don't get what you are trying to illustrate with ToString.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|