1 Reply Latest reply on Feb 8, 2007 6:59 AM by rickLep

    Object duplication problem


      I have to following problem:
      I have an object (an instance of the class which is included) which will contain a maximum of 4 objects with arrays inside them. After creation of the second object inside the class instance a reference object is created instead of a new object. Although I think it's a reference, because when I use classInstance.setTxt() and then getTxt() on item0 and item1, the same values are returned, instead of different values, since I only want to edit text in item0 or item1 and not both...

      I even used the for loop to copy the object as you can see, but it makes no difference. Please help me out.

      Thanks in advance,

        • 1. Re: Object duplication problem
          rickLep Level 1
          Hi again,

          already solved the issue. I had to add another for loop, since I wasn't copying values, but array-objects into the new object. This way references are still created, so I had to loop through the arrays too and copy each value into the newly created array inside the new object...