Merge Method (NamedValues collection)

             

 

Merges another NamedValues collection into this one, by copying its members.

 

Syntax

object.Merge Source, ReplaceDuplicates

The Merge method syntax has these parts:

Part

Description

object

An object expression that evaluates to a NamedValues collection.

Source

An expression that evaluates to a NamedValues collection. Each member of the source collection is copied, and the copies are added to the collection.

ReplaceDuplicates

An optional Boolean expression, as described in Settings.

 

Settings

The settings for ReplaceDuplicates are:

Settings

Description

true

If the collection previously contained any NamedValue with the same name as any members of the source collection, the values taken from the source collection replace the old values. This is the default.

false

If the collection previously contained any NamedValue with the same name as any members of the source collection, the old value remains unchanged and an error is reported.

 

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 property is true.

pseDUPLICATENAME

The source collection contains one or more items with the same names as members of this collection, but ReplaceDuplicates is false. All items whose names are not duplicates are merged.

Enabling Operational Intelligence