CImCombine:Copy
The Copy method duplicates the current CImCombine and returns the new object.
C = CImCombine:Copy() where |
C is a new CImCombine object containing the same values as the current one. On failure, nil is returned.
This method copies an existing CImCombine and returns a reference to the new CImCombine. You cannot copy a CImCombine or other class object using the trivial statement B = A, as this simply makes the value of B a reference to the object A. In other words, B becomes an alias to A. To get around this, two copy methods are provided by the CImCombine class:
To create a CImCombine that is a copy of the current object, use the Copy method. This creates a new CImCombine B before duplicating the values of the current object A. For example,
|
-- CImCombine A already exists |
To create a new CImCombine that is a copy of an existing object, use the copy constructor, as in
|
-- CImCombine A already exists |
Choose the syntax that fits best with your script.
The following script duplicates the CImCombine C into a new CImCombine C2:
|
-- create a CImCombine |
|
-- set some members |
|
-- creates a duplicate CImCombine A2 |
|
-- result: verbose = 1 |