wwUtils::CopyObject

Creates a copy of an object by creating a brand new object and copying all properties including all nested objects from scratch.

This function creates a brand new object that has no reference whatsoever to the object that was passed in. All data is copied and recreated. Any surrogate object properties are also recreated from scratch resulting in a new object that is independent of any previous references.

1 Dimensional arrays and 1D arrays containing objects are also supported and generate new instances for each array element.

CopyObject(loInput)

Return Value

New Object reference

Parameters

loInput
Object that is to be copied. Any child objects are also copied and assigned to child object properties.

lcPropertyExclusionList
Optional comma delimited list of properties that are not copied. If empty a default list is used that includes all the FoxPro intrinsic property names of Custom/Relation properties.

To truly use an empty list that you can use on objects based on EMPTY you can pass ,.

The default property list includes:

activecontrol,classlibrary,baseclass,comment,controls,objects,controlcount, class,name,parent,parentalias,parentclass,helpcontextid,whatsthishelpid, width,height,top,left,tag,picture,onetomany,childalias,childorder, relationalexpr,timestamp_column

Remarks

Only one dimenensional arrays are supported for array memembers. Multi-dimensional arrays are flattened to a single dimension.


See also:

Library wwUtils

© West Wind Technologies, 2023 • Updated: 11/25/19
Comment or report problem with topic