Copy Method (NamedValues collection)

             

 

Copies an existing NamedValue and adds that copy to the collection.

 

Syntax

object.Copy Source, ReplaceDuplicates

The Copy method syntax has these parts:

Part

Description

object

An object expression that evaluates to a NamedValues object.

Source

An object expression that evaluates to a NamedValue object. This object is copied, and the copy is added to the collection.

ReplaceDuplicates

An optional Boolean expression, as described in Settings.

 

Settings

The settings for ReplaceDuplicates are:

Setting

Description

true

If the collection previously contained a NamedValue with the same name as the new object, the value of the new object replaces the object’s old value. This is the default.

false

If the collection previously contained a NamedValue with the same name as the new object, the old value remains unchanged and an error is reported.

 

Remarks

Returns a reference to the newly created NamedValue object.

 

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.

pseDUPLICATENAME

The new object has the same name as a member of this collection, but ReplaceDuplicates is false.

Enabling Operational Intelligence