Results 1 to 5 of 5

Thread: Collections

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    Hello, I am having trouble grasping the whole concept around collections. I was just wondering if i could get a different point of view or an example.. Thanks

  2. #2
    Hyperactive Member MPrestonf12's Avatar
    Join Date
    Jun 1999
    Location
    NY
    Posts
    330

    Lightbulb i think..

    As I understand it collections include different items for example on your form. There could be a collection of textboxes or commandbuttons. It can be usefull when you want to set values to all textboxes or other controls on your form. You would simply set up a loop that accounted for each item in the collection of textboxes. Hope this helps :-)
    Matt

  3. #3
    Guest
    MPrestonf12: I think you are referring to Arrays.

    mpSmooth: A collection is basically used to organize data together. For example, if you needed to keep track of peoples name's, you could use a collection for it.
    Code:
    MyCollection.Add Text1
    In the above example, (assuming you have a TextBox), whatever is entered in the TextBox would be entered in the collection; like a record.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I think MPrestonf12 is refering to Controlarrays

    Collections are linked lists, sort of like arrays, but slower when it comes on accessing and faster when it comes to adding and removing items. Therefore i don't recommend you use it unless you are adding and removing items frequently.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217

    thank you

    I understand what you are saying, thank you for clearing things up. I just was never sure when to use an array or a collection. Thanks again...

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