Hello,

I didn't even know you could assign arrays like that using an equal sign. New feature in 2005/2006? It sounds like MyCancelArray is just storing a reference to MyActualArray, rather than duplicating the contents.

I would suggest copying the array yourself, using a for/next loop:

dim Count as integer = Ubound(MyActualArray)
Redim MyCancelArray(Count)

for i as integer = 0 to Count
        MyCancelArray(i) = MyActualArray(i)
next

On May 2, 2006, at 1:59 PM, Mark O'Neill wrote:

Sorry - forgot to mention: RB2006r2, OSX 10.4.6

Thanks,

Mark.

On 2 May 2006, at 21:57, Mark O'Neill wrote:

Hi All,

OK, so I'm saving the state of my array like this

MyCancelArray = MyActualArray

Whereby both arrays are of the same type. I'm
doing this ONCE, and ONCE ONLY when my
customize window opens in case the user
wants to cancel changes so that they can revert
back to the previous state.

So, in the cancel button I have:

MyActualArray = MyCancelArray

...to revert. Except, it doesn't.

The process of events is such:

1. User opens the Customize window
2. I do the MyCancelArray = MyActualArray
3. User does some changes.
4. User presses Cancel, so I do the:
     MyActualArray = MyCancelArray

But the WEIRDEST thing happens. For some
reason both arrays are identical, even if
MyActualArray has been changed!! It's driving
me up the wall. I've checked in case I'm calling
MyCancelArray = MyActualArray somewhere
else in code, but I'm not - in fact, that line only
appears in 1 method, and I've even put a
MsgBox line in that method to ensure it's not
being called again.

But no matter how I look at it, MyCancelArray
always seems to be the same as MyActualArray
when I come to cancel - even though MyActualArray
has changed.

This is probably something very stupid that I'm
doing, but I was hoping that someone else on
here has done something equally as stupid so
I can be put out of my misery! ;)

Thanks for your help.

All the best,

Mark.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to