Author |
Topic  |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 13 June 2001 : 05:37:35
|
I have a collection and I wonder why the following doesn't work.
If mycollection is Nothing then ... do something
The problem is that when mycollection.count = 0 the above condition is still false. Why? Could someone explain this a bit?
Regards,
Paco
Trying to learn more ... but can't never get enough
|
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 13 June 2001 : 13:30:29
|
quote:
I have a collection and I wonder why the following doesn't work.
If mycollection is Nothing then ... do something
The problem is that when mycollection.count = 0 the above condition is still false. Why? Could someone explain this a bit?
Regards,
Paco
Trying to learn more ... but can't never get enough
I could be wrong (my experience with collections is limited), but the VB Nothing means the object isn't pointed at anything. If myCollection is pointed at an empty collection, it's not equal to Nothing, but myCollection.count does equal 0.
-Dan
|
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 13 June 2001 : 16:47:21
|
quote:
I could be wrong (my experience with collections is limited), but the VB Nothing means the object isn't pointed at anything. If myCollection is pointed at an empty collection, it's not equal to Nothing, but myCollection.count does equal 0.
That would be my interpretation too, nothing means there is no memory allocated for the object, ie it doesn't exist. Which as you say is not the same as an empty object.
|
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 14 June 2001 : 03:37:19
|
Thanks, that makes sense
|
 |
|
|
Topic  |
|