CValueSet:Copy
The Copy method duplicates an instance of the CValueSet class or a table of pairs. The members of the old CValueSet or lua table become elements of the current CValueSet object. The CValueSet is emptied before the old object is copied. The type of the CValueSet becomes the type of the copied CValueSet. The new method may also be used to copy an existing CValueSet when the new object is created.
count = CValueSet:Copy( CValueSetOld )
Copies all members of CValueSetOld into the CValueSet object. Returns the number of members in the CValueSet.
count = CValueSet:Copy( tbl )
Copies all pairs of the lua table into the CValueSet object. Each table member must consist of a string key and a value. Returns the number of members in the CValueSet.
The following example creates a CValueSet S, adds members to it, then copies the members to a second CValueSet:
|
-- constructa CValueSet object of type "number" |
|
-- add a key and value |
|
-- add a key and value |
|
-- add a key and value |
|
-- construct a new CValueSet object |
|
--copy the members of S into S2 |
|
-- result: CountNew = 3 |
CValueSet Class, new, delete, CSet
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.