-
I got a problem with the collection object in Visual Basic 6.
A maximum of 256 items can be added in a collection. But, if you pass this limit, no more item are add in collection, but the count property continue to expand.
Example:
Dim colTest As New Collection
Dim iCpt As integer
For iCpt = 1 To 300
colTest.Add iCpt
Next
The collection contents 256 items, but the count property is 300.
Why?
-
I dunno this sort of stuff but somewhere I saw this:
Code:
Dim Something As String * 32
'So why don't you try:
Dim colTest As New Collection * 2
As I said before, I dunno what this does.
-
It'll be a bug, VB's full of them.
If you're desperate you cuold create a wrapper class for collections, involving a collection of collections acting as one. that way you could have a maximum of 65536 items. And this time sort out the count property properly.
-
I just wanted to add a little something here
I thought the maximums items in a collection was 256 but it's not. The bug is when you try to look a the collection in a debug window, it only shows the 256 first items. If you try to access the other items in your code, it works well.