Have you ever used Collections? Collection Classes?

Showing Answers 1 - 1 of 1 Answers

asohaney

  • Mar 6th, 2008
 

Visual Basic has a very handy Collection object built in. You can add and remove items and not worry about bounds like with arrays. It is very useful but does have some shortcomings. For example you can remove a single item but what about erasing the whole collection in one fell swoop? If you've used a list box you'll have noticed that you clear all the list items by ListBox1.Clear - simple eh? Well in a collection object each item must be individually removed!

If you use the class builder add in for VB (good, but not as good a visual modeller!) then you will realise that you can create custom collections based on an existing class. It functions the same as a regular collection, except the ‘add’ method takes parameters and builds a new object to add.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions