[fpc-pascal] Clone a instance of object

Graeme Geldenhuys graeme at geldenhuys.co.uk
Mon Sep 23 11:58:58 CEST 2013


On 23/09/13 10:46, Michael Van Canneyt wrote:
> I've done this several times, it works well for most situations.

My I also suggest Zaher takes a look at tiOPF's code to see how they
implement class cloning.

Also be careful about the pitfalls of cloning a class. eg: How you want
to handle more complex cases. eg: Cloning a class with a reference to
another class, or cloning a class with an embedded class (field), etc...
tiOPF's implementation allows the developer to decided how such cases
should be handled.

Regard,
  Graeme.





More information about the fpc-pascal mailing list