VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: comparing UDT's Rag on a Stick (3 replies, 0 views) (2001-Oct-3) You have to compare each element within the UDT individually. It is a type mismatch because the = operator does not support UDTs. For example:
<tt><pre>
Type udtPoint
X As Long
Y As Long
End Type
Function AreEqual(A As udtPoint, B As udtPoint) As Long
If A.X = B.X Then
If A.Y = B.Y Then
AreEqual = -1
End If
End If
End function
</pre></tt>
The reason you can't just compare them by A = B is because inside the UDT you might have elements which can't really be compared... say 2 object references.
|