[Gambas-user] some questions around collections copy and collections inside collections

PICCORO McKAY Lenz mckaygerhard at ...626...
Tue Sep 6 21:39:52 CEST 2016


i have a function that returns a collections of collections, named
getPedidogeneral

i mean, this function returns object coll1 that inside each key is a id of
a object that also are a collection too

i try to copy the firts to other, i mean coll2 = coll1.copy() or coll2 =
coll1

i noted that the refers inside coll1 are the same as coll2!

the problem are that if i modified some keys of the coll1 object, same key
in the coll2 object also its modified!

and so the only way to modified each collection without affecting the other
its obtain a copy with differents references but same contents, so i must
recall the function for that!

to ilustrate i posted a image


​

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot029.png
Type: image/png
Size: 194305 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20160906/87424e61/attachment.png>


More information about the User mailing list