|
-
Aug 29th, 2005, 06:48 PM
#1
Thread Starter
Lively Member
Creating rules for adding/subtracting 2 structures
Ok, I have a structure
Public Structure someStructure
Dim settingName As String
Dim settingValue As Integer
End Structure
Dim T1 as someStructure
Dim T2 as someStructure
now i want to call T1+T2 and obviously only add up the settingValue part of structure which is an integer.
i know there is a way to define how the + operator is used in C++, and I'm wondering if there is a fairly simple way to do it in VB.net. I can obviously write a simple function to add them together, but if there was a way to overwrite the + operation on that it would be sexy and clean at the same time. sorry, but i'm a .net newbie
Luc L.
-
Aug 29th, 2005, 07:33 PM
#2
Re: Creating rules for adding/subtracting 2 structures
Operator Overloading isn't supported until 2005. The closest thing you can do is make a function to do the work then call it.
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
|