Results 1 to 4 of 4

Thread: Maximum items in a collection

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    1

    Question

    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?

  2. #2
    Guest
    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.

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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.

  4. #4
    New Member
    Join Date
    Jan 2002
    Location
    Montreal, Canada
    Posts
    12
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width