2014-03-19 19:01 GMT-03:00 Timothy Groves <the.tail.kin...@gmail.com>:
> Is there a drop-dead simple way to clone an object? > > I've got a small tree of classes (tBaseProfile, and four descendants of > such). Only the descendant classes are instantiated. I need to be able to > create new copies of these objects for use in other lists. > > At the moment, I am writing a Duplicate method that returns the new > object. But this means assigning all of the data to the duplicated object. > There must be an easier way! I'm working on something right now (using RTTI). I need to clone any object, even third party objects. I use an OPF and a HTTP framework and both work directly with objects, and now came the need to clone objects ( http://goo.gl/VVTFcu). I'll post the code here soon ... -- Silvio Clécio My public projects - github.com/silvioprog
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal