
Compare user defined data types
Quote:
>Since there is no operater overloading in VB, the only way to compare UDDT is
>to create function which does it. For your example:
>Private Function TestEqual (mtEqual1 as mytype, mtEqual2 as mytyme) as Boolean
>Dim x as Integer
>x=0
>if mtEqual1.Age = mtEqual2.Age then
> x = x + 1
>end if
>if mtEqual1.Name = mtEqual2.Name then
> x = x + 1
>end if
>if x=2 then
> TestEqual =True
>else
> TestEqual = False
>end if
>End Function
>-Dan
You could also store each UDT, using LSET, in two instances of a third
UDT consisting of a byte array sufficiently large to hold your UDTs,
and then compare these byte by byte.
I've just posted a message which basically requests a vb function to
allow UDT to be stored in strings. This might allow you to compare
strings.