How clone objects?
BlitzMax Forums/BlitzMax Programming/How clone objects?
| ||
Hello people. How i can clone objects in BMax? Having: Type myObject Field name:String Field x:Int Field y:Int End Type Local a:myObject a.name = "temp" a.x = 10 a.y = 10 Local b:myObject I want to clone a on b. Any solution? thanks. |
| ||
Either create a clone function for each type, or use reflection like this |
| ||
I had the same problem in this thread: http://www.blitzbasic.co.nz/Community/posts.php?topic=82368 And I ended up using Azathoth's code ;-) BTW Thank you Azathoth for sharing it :) |
| ||
Ok I resolve the problem using some code of Azathoth's solution. Thanks |