[Gambas-user] How to clone an object?

martin p cristia tercoide at hotmail.com
Thu Apr 23 23:19:32 CEST 2020


I want a clone an object I dont know what Class it is.

Public <http://gambaswiki.org/wiki/lang/public> c1 as 
<http://gambaswiki.org/wiki/lang/as> New 
<http://gambaswiki.org/wiki/lang/new> Clase1             ' These classes 
may have arrays of other classes Object[]
Public <http://gambaswiki.org/wiki/lang/public> c2 as 
<http://gambaswiki.org/wiki/lang/as> New 
<http://gambaswiki.org/wiki/lang/new> Clase2 ' All diffent
Public <http://gambaswiki.org/wiki/lang/public> c3 as 
<http://gambaswiki.org/wiki/lang/as> New 
<http://gambaswiki.org/wiki/lang/new> Clase3
Public <http://gambaswiki.org/wiki/lang/public> c4 as 
<http://gambaswiki.org/wiki/lang/as> New 
<http://gambaswiki.org/wiki/lang/new> Clase4


' at this point we don't know
Public <http://gambaswiki.org/wiki/lang/public> 
Function<http://gambaswiki.org/wiki/lang/sub> ClonMe(original as 
<http://gambaswiki.org/wiki/lang/as> Object 
<http://gambaswiki.org/wiki/lang/type/object>) as 
<http://gambaswiki.org/wiki/lang/as> Object 
<http://gambaswiki.org/wiki/lang/type/object>

' a New object of the same kind with all variables/properties and 
constants with the same values
?????

End <http://gambaswiki.org/wiki/lang/end>


-- 
Saludos

Ing. Martin P Cristia

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200423/8642047b/attachment-0001.html>


More information about the User mailing list