-
compare UDT
HI everyone
I have two instance of a UDT (user defined type) that I need to compare. The UDT contains variable-length strings, longs, integers, singles, and booleans, altogether about 50 data members.
I need to compare the two and determine if any data members have different values. If any data member is different, I need the name of the data member and the values.
I could write if statements to access each member and compare it, but doing that 50 times is pretty cumbersome. Is there a more elegant method?
I'm running VB6.
suggestions are apprecaited
-
-
are you saying its possible with vb.net?
-
Even if you did a byte-by-byte comparison they would never be equal. When you use a variable length string, you are actually referencing a Long that contains the address of the first byte of a Unicode character array. So, the corresponding strings in each UDT will contain different addresses