SetSize Method (NamedValues collection)

             

 

Sets the current actual size of the collection.

 

Syntax

object.SetSize [= Long]

The SetSize method syntax has these parts:

Part

Description

object

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

Long

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

 

Remarks

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

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 SetSize first.

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

SetSize 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:

Error

Description

pseACCESSDENIED

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

 

Enabling Operational Intelligence