from the code example below, a cloned object keeps referencing the same object:
Code: Select all
x := []
y := []
y[1, "type"] := "y1 type"
y[1, "option"] := "y1 option"
y[1, "header"] := "y1 header"
x["YObject"] := y ;stores object "y" reference in x["YObject"]
YReference := x["YObject"]
z := YReference.Clone()
z[1, "header"] := "z1 header"
;the line above modifies y[1, "header"] to "z1 header" (but it shouldn't since "z" contains reference of a "y" clone!)
msgbox, % ""
. y[1, "type"] " - " y[1, "option"] " - " y[1, "header"] "`n"
. z[1, "type"] " - " z[1, "option"] " - " z[1, "header"] "`n"