Important: The information in this document is obsolete and should not be used for new development.
Creating or Disposing of a CollectionThe Collection Manager provides a number of ways for you to create a collection object:
- You can create a new collection object using the
NewCollectionfunction, as described in this section.
- You can make a copy of an existing collection object using the
CopyCollectionfunction, as described in "Cloning or Copying a Collection" beginning on page 5-14.
- You can create a collection from a resource using the
GetNewCollectionfunction, as described in "Reading Collections From and Writing Collections to Disk" beginning on page 5-41.
NewCollectionfunction creates a new collection object containing no collection items. The section "Adding Items to a Collection" beginning on page 5-17 shows how you can add items to a new collection.
The default attributes of the new, empty collection are described by the defaultCollectionAttributes constant, in which only the persistence attribute is set. This constant is defined in "Attributes Masks" beginning on page 5-49. The section "Changing the Default Attributes of a Collection" beginning on page 5-15 shows how you can change the default attributes of the new collection.
The owner count of the new collection is 1. You can increment the collection's owner count using the
CloneCollectionfunction, as shown in the section "Cloning or Copying a Collection" beginning on page 5-14. You can decrement the collection's owner count using the
DisposeCollectionfunction. This function decrements the owner count of a collection and frees the memory used by the collection if the owner count becomes 0.
You can find more information about the
NewCollectionfunction on page 5-54. You can find more information about the
DisposeCollectionfunction on page 5-55.