Article ID: 88551 - Last Review: December 12, 2003 - Revision: 2.0 How to Compare User-Defined Type Variables in Visual BasicThis article was previously published under Q88551 On This PageSUMMARY
The relational operators (=, <>, and so on) do not support the comparison
of user-defined type variables. However, you can compare user-defined type
variables by converting the variables to strings, and then comparing the
strings. The Windows version 3.1 API hmemcpy can be used to convert a
user-defined type variable to a string. The hmemcpy API was introduced in Microsoft Windows version 3.1, so this technique requires Windows version 3.1 or later. MORE INFORMATION
If you attempt to compare user-defined type variables using the relational
operators, the error "Type mismatch" is displayed. The following steps demonstrate how to compare user-defined type variables by first converting the variables to strings and then comparing the strings by using the relational operators. Step-by-Step Example
APPLIES TO
| Article Translations
|

Back to the top
