When i click Button1 there's apparently only 1 Winsock created, even though i create 3 (using New each time the sub is called). I get a script out of range error when I click Button2, because there is only Index 0 (because it's only created 1 object). I've just moved on from VB 6, this is all new. Can you please tell me what I'm doing wrong?
That fixed everything up! It now creates 3 items and i can read the tag of them all. Thank you.
Slyke Tuesday, June 13, 2006 5:39 PM
Spotty is correct, the array is zero-based. You don't need to manually maintain a count of the items as the list has a .Count property that returns the number of items in the collection.
Richard_Wolf Tuesday, June 13, 2006 5:42 PM
I manually maintain it because i have another array that's a boolean. I use this array to keep a checkup on wether or not a Winsock is connected, (incase i want it to think it's connected if i want to use that paticular winsock for something else). This just helps keep count of all the Winsocks i currently use. If one disconnects, then a new connection will take it's place, or it will add 1 more to the array and to that integer. It just makes it easier for me .
Slyke Tuesday, June 13, 2006 5:48 PM
Understood. You might consider making a class that contains the winsock and any associated data you need to maintain then have an array of the classes in your main form rather than the winsock itself.