[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-user
Subject:    [Gambas-user] An other OO problem.
From:       "Jussi Lahtinen" <jussi.lahtinen () gmail ! com>
Date:       2009-01-15 0:48:18
Message-ID: 384d3900901141648m2adbe7ay94f6848d9e12824b () mail ! gmail ! com
[Download RAW message or body]

Hi!
Again I'm having OO headache (I'm OO newbie).
I have very simple task, and I believe the solution would be as
simple... I just don't get it.
I need to make independent copy of object, from collection A to collection B.

I tried following (among other things):

Dim A as NEW Collection
Dim B as NEW Collection

...
A.Add(B[n])
...

But the result is something like same object in both collections.
When I do example;

A[n].X = 1234

Then the corresponding object in collection B changes too;

PRINT B[n].X
1234

I could do this;

...
A[n].X = B[n].X
A[n].Y = B[n].Y
...and so on...

But those objects have very many variables, object arrays etc.!
I really hope there is an other way...
Thanks!


Jussi

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic