|
-
Aug 18th, 2002, 03:13 AM
#1
*resolved* '= 'not supported for structures
well, structures are value types but the '=' opperator isnt supported for them.... I tried the Equals method and sounds like it works. Is that the best way to compare variables of structures?
Last edited by MrPolite; Aug 18th, 2002 at 10:25 PM.
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Aug 18th, 2002, 12:44 PM
#2
PowerPoster
In C# you can overload operators which would do what you want, but VB you can't. You are going to have to probably go the other route if you do the structure in VB.
-
Aug 18th, 2002, 05:46 PM
#3
umm, I dont even know why "=" isnt supported for them so basically the Equals() function is the correct way for this, right?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Aug 18th, 2002, 10:19 PM
#4
PowerPoster
Even when you compair two types like integers, it is overloading the = operator. When someone designed the integer class, they overloaded the = operator so when you compair two integers, it compairs the values that the class holds. If they didn't do this, then you would only be compairing two instances of the integer class. If those two variables didn't point to the same object, then they wouldn't be equal.
What I would do if I were you is create the structure in C#. Overload the = operator, then in VB when you create the instances of the struct, you could compair them with the = operator like you want to do.
-
Aug 18th, 2002, 10:25 PM
#5
Originally posted by hellswraith
Even when you compair two types like integers, it is overloading the = operator. When someone designed the integer class, they overloaded the = operator so when you compair two integers, it compairs the values that the class holds. If they didn't do this, then you would only be compairing two instances of the integer class. If those two variables didn't point to the same object, then they wouldn't be equal.
What I would do if I were you is create the structure in C#. Overload the = operator, then in VB when you create the instances of the struct, you could compair them with the = operator like you want to do.
I'll put that in the list so whenever I learn C# I would be able to do it
thanks for the info
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|