A collection is an Xbasic datatype, similar to an array, but whose elements are referenced with a "key" rather than an index. A key is a value (character, numeric or date) that uniquely identifies an element in a collection.
For example, in the following collection, the key BB refers to the element Bryan Boyd.
For example, say that the collection shown below was called mycollection. The command: mycollection.GET("BB") refers to the collection element Bryan Boyd.
By contrast, in an array, elements are referred to by index number. For example, say that the array shown below was called " myarray ". The command: myarray2 refers to the 2 nd array element.
You do not have to declare the size of a collection in advance. The following command defines a collection. There is no maximum number of entries in the collection (other than limits set by available memory).
dim mycollection as U