Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

cMyCmd.vb(24): Operator '<>' is not defined for types 'System.UInt32' and 'System.UInt32'.

 

This is not a problem, it's easily skipped by converting them to Int64's... but I'm just wondering what's the cause of this :P

 

I don't get it :)

You can't compare two integers of the same type, but you can first convert them to signed 64bit and then compare.

 

Anyone else bumped to this?

BS - Beer Specialist
  • Leaders
Posted

you can use the Equals method ( also there's a CompareTo method , which returns -1 for False , or 0 for True )

       Dim uint1 As UInt32 = Convert.ToUInt32(123)
       Dim uint2 As UInt32 = Convert.ToUInt32(123)

       Dim bResult As Boolean = uint1.Equals(uint2) '/// compare the 2 UInt32's using Equals

       MessageBox.Show(bResult)

Posted

Thanks, didn't notice that function.

 

Do you have any reason for using UInt32?

Yes, I'm working with libMySQL.dll which returns uints. Haven't tried though if Int64s work (return values will get screwed?).

BS - Beer Specialist

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...