comparing two VARIANTS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi

when I try to compare two VARIANTS, i get a compilation error.

when i tried the same in version visual studio 7.0 it works fine but with
7.1 it gives me the following compilation error:
binary '!=' : no operator found which takes a left-hand operand of type
'VARIANT' (or there is no acceptable conversion)

can any one help

Thanks
 
Vasuki said:
hi

when I try to compare two VARIANTS, i get a compilation error.

when i tried the same in version visual studio 7.0 it works fine but with
7.1 it gives me the following compilation error:
binary '!=' : no operator found which takes a left-hand operand of type
'VARIANT' (or there is no acceptable conversion)

can any one help

Thanks
The (somewhat) equivalent generic type in .NET is Object. If you are using
VB 6 or earlier, I'd suggest posting in:

microsoft.public.vb.general.discussion

or one of the other microsoft.public.vb... groups.

Consider using Object instead and using Is and IsNot for comparisons per:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vadatobject.asp
 
Back
Top