COMPARING CUSTOM COLLECTIONS TO ARRAYS

Now you know the basics for declaring a new collection and for adding and removing elements from the collection. In the following sections, you create a simple collection of integers, as well as an array of integers. The array takes three elements, calculates the number of elements, removes an element, and displays all the elements. You should recognize the advantages of collections at the completion of this example.

Creating a Collection of Integers

The code in Listing 4.1 declares a new collection by using the New keyword, adds elements to the collection, accesses an element of the collection, lists the elements of the collection, removes an element from the collection, and then displays the number of ...

Get F. Scott Barker's Microsoft® Access 2000 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.