[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to correctly use the new Equals()


Le 09/10/2024 à 18:36, Brian G a écrit :
This is not equal:

    Public ab As Collection
    Public aa As Collection
    aa = ["aa": "aa", "bb": "bb", "cc": ["xx", 1, 2, 3]]
    ab = ["aa": "aa", "bb": "bb", "cc": ["xx", 1, 2, 3]]
    If ab.Equals(aa) Then
         Print "yippy"
     Else
         Print "boooo"
     Endif

Is there a better explanation what equals() actually means when true?



It's always the same problem than deep copy: this is not a deep comparison. Only the values of the keys are compared, and the two arrays associated with "cc" are different arrays, with the same values, but different.

In other words, Equals() does not compare the inner values with Equals().

But it could, but that needs more work, and I will do it if it's not complex.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: How to correctly use the new Equals()brian <brian@xxxxxxxxxxxxxxxx>
References:
How to correctly use the new Equals()Brian G <brian@xxxxxxxxxxxxxxxx>