MTSetSize Method (MTNVS collection)



Sets the current actual size of the collection.



object.MTSetSize [= Long]

The MTSetSize method syntax has these parts:




An object expression that evaluates to an object in the Applies To list.


A Long expression, indicating the maximum number of MTNV objects that this collection is currently configured to contain.



It is an error if you try to set the collection size smaller than the current value of MTCount.

You never need to set this value. The collection automatically resizes itself as required. However, if you are about to add a large number of values to the collection, performance may be improved if you call MTSetSize first.

You may also use this method to truncate a MTNVS collection to the given size, freeing unused memory.

MTSetSize is marked hidden in the type library. To see this method in an object browser, you may need to select the browser’s “Show Hidden Members” option.


Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:




The collection cannot be modified because it is frozen; that is, the collection's MTReadOnly flag is true.


Enabling Operational Intelligence