MTClone Method (MTNVS interface)



Returns a MTNVS collection that is an exact copy (except for the ReadOnly property) of this collection.




The object placeholder is an object expression that evaluates to an MTNVS Interface.



The returned value is an MTNVS object.

It is much faster to clone an existing collection than it is to call CoCreateInstance (VC++), call CreateObject (VBScript), or use the New operator (VB). If you need a lot of MTNVS collections and performance is important, it may be best to create only one collection and clone it as many times as necessary.

The returned collection is a copy of the existing collection, in all respects except for the MTReadOnly property. This includes the MTSorted and MTStyle properties, and any internal effects of the MTSetSize method. If this collection's MTCount property is greater than zero, the MTNV members of the returned collection are copies of the members of this collection.

The MTReadOnly property of the returned collection is always false. If you want to duplicate that property as well, you may write code similar to this:

Dim newcoll as MTNVS
Set newcoll = oldcoll.MTClone
if oldcoll.MTReadOnly then newcoll.MTFreeze
Enabling Operational Intelligence