Hi Edgard, I can't answer your question at the moment, but I think there's a mistake in the logic you're using: If ArrayB = ArrayA is storing a reference to ArrayA in ArrayB, in other words a pointer to the address where ArrayA is located in memory, then if you change the contents of ArrayA afterwards, ArrayB would also lose the original contents and show the new contents of ArrayA. So the only way to save the contents is an item by item copy, there's no way to avoid that.
The alternative is that you use a new array for the new contents and just keep the old one. Or, if you want a more sophisticated solution, you can use a 2 dimensional array, and change the first index when you want to proceed to a new array. That way, you avoid the copying process, which could get lengthy for large arrays. Kind regards Thomas Am 06.10.2008 um 01:16AM schrieb elriba75: > Hi, > > Suppose I have an array called ArrayA, and I want to save a > reference to it. > > ArrayB = ArrayA > > So that I can now use ArrayA for something else: > > ArrayA = "" > > I can now use ArrayA for something else; however, ArrayB still > contains the array in case I need it. > > The question is this: Is the ArrayB = ArrayA statement a "reference > assignment", or does it involve an item by item copy? > > The reason I ask is that in my case ArrayA may be at a given time > rather large, and if it involves an item by item copy, it seems to me > it might take a long time to do the copy; on the other hand, if it is > just a reference assignment, then it would be instantaneous. > > I know that in the case of object, it is just a reference assignment, > but I don't know for arrays and other variables what it is doing. > > Anyone knows? > > Best regards, > Edgard > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~----------~----~----~----~------~----~------~--~---