Re: Array Compare



What is the best method to compare 2 array to knw if each element is
equal?
Now, i have to compare the datarow.itemarray of 2 datarows wich is equals
in
structure.
I tried to write this routine: (OPTION STRICT MUST BE ON!!)
Private Function ISArrayEquals(ByVal A As Array, ByVal B As Array) As

Is this for ADO? It does not look like it. Is it ADO.NET? (Off-topic in this
newsgroup)

I would compare number of dimensions and size first.
If they are not equal then return false
Then check the types are the same
If they are not equal then return false
Finally check the values
If they are not equal then return false
otherwise return true.

But if this is trying to see if 2 tables on a database contain the same
elements, a JOIN is cheaper to do.
Get the database engine working for you.

Stephen Howe


.



Relevant Pages

  • Re: Help! Need to sorted collection accessible by key
    ... Equals() and GetHashCode, then return the hashcode of the key you want ... access with, and compare by the one you want to order by, and put it ... If two items that compare equal using the _hasher key do not compare ... hash to the same bucket in the hash table but will not be equal to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Interesting list Validity (True/False)
    ... Python to compare those strings equal. ... "a equals d" is true. ... There may or may not be any coercion involved.) ... And if you ask any mathematician, he'll say that is equal to. ...
    (comp.lang.python)
  • Re: Reading specific memory address into variable
    ... cons_pi and it equals 3.14159265358979. ... for how many times they want to do that calculation to figure out pi (4/1 - ... which is where I was stuck trying to figure out a way to compare the two ... incrementing the accuracy variable by 1 and incrementing the multiply ...
    (comp.lang.cpp)
  • Re: Interesting list Validity (True/False)
    ... The exceptions you mean are not exceptions to "'X==Y' means 'X equals ... "Obbjects of different types never compare equal". ... The exceptions being different numeric types and different string types, that have a special treatment; see section 5.9 in the Reference Manual for details." ...
    (comp.lang.python)
  • Some Opinions on this code block ?
    ... diverse, including enums, basic system types, arrays and nested types. ... for equals, compare ... ... code block in and then run it. ...
    (microsoft.public.dotnet.languages.csharp)