AfterCopyProc

CloneObject

This cool method lets you create an exact (well, almost exact) duplicate of an object. The only difference between the two is the name you assign the new one. The only bad thing we have to say about CloneObject is that it's available only at design-time—we can think of all kinds of cool things we could do with it at runtime.

Usage

oObject.CloneObject( cNewName )
The newly cloned object becomes a member of the same container the original object is in. That is, if you clone a label on a form, the new label is added to the same form.

All the properties and methods of the original are copied to the clone.

Example

* Assume the Form Designer is open and a single object (that * sits right on the form) is selected. = ASELOBJ(aObject)    && Get a reference to the selected object = ASELOBJ(oContainer, 1)     && Get a reference to the form aObject[1].CloneObject( "NewOne" ) * Now we can reference it through the container ? oContainer[1].NewOne.Name  && Returns "NewOne"

See Also

AddObject, AddProperty, ASelObj()


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net