Hello,
Is there anyway to override operators (+,- etc) in VB .NET or is this only
possible through C#?
I want to create a class that can override these operators.
Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk www.headfirst.co.uk www.callofcthulhu.com
- 9 1969
Hi Simon,
Simple answer, planned in next version of VB.net, so now only C versions, (I
do not know about J#)
I hope this helps?
Cor Is there anyway to override operators (+,- etc) in VB .NET or is this only possible through C#?
Thanks for your reply,
Trying to get around the System.UInt32 not having the +/- operators. Its a
bit tedious having to do a number of conversions to perform an addition.
Trying to work out a way of making to code a bit more elegant but will
convert to Whidbey without many changes etc...
Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk www.headfirst.co.uk www.callofcthulhu.com
-
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Hi Simon,
Simple answer, planned in next version of VB.net, so now only C versions, (I do not know about J#)
I hope this helps?
Cor Is there anyway to override operators (+,- etc) in VB .NET or is this only possible through C#?
* "Simon Jefferies" <si****@headfirst.co.uk> scripsit: Trying to get around the System.UInt32 not having the +/- operators.
These operators will be available in VS.NET 2005.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
* "Simon Jefferies" <si****@headfirst.co.uk> scripsit: Is there anyway to override operators (+,- etc) in VB .NET or is this only possible through C#?
Overriding? Overloading will be possible in VB.NET Whidbey, 2005.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
> These operators will be available in VS.NET 2005.
Hi Herfried,
Are you sure that is not the next version of VB.net?
Cor
Hi Herfried,
See my reply on your other message in this thread?
Cor
* "Cor Ligthert" <no**********@planet.nl> scripsit: See my reply on your other message in this thread?
Yep.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Simon,
Have you considered using C# for all your UInt32 work, at least until
Whidbey ships. Then calling the C# class library from VB.NET? In other words
encapsulate all the unsigned logic in C# classes...
Alternatively depending on how I am actually using the UInt32, I will simply
use an Integer (which is fully supported) any place I would have used a
UInt32...
Hope this helps
Jay
"Simon Jefferies" <si****@headfirst.co.uk> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl... Thanks for your reply,
Trying to get around the System.UInt32 not having the +/- operators. Its a bit tedious having to do a number of conversions to perform an addition. Trying to work out a way of making to code a bit more elegant but will convert to Whidbey without many changes etc...
Regards Simon Jefferies Tools Programmer, Headfirst Productions mailto:si****@headfirst.co.uk www.headfirst.co.uk www.callofcthulhu.com - "Cor Ligthert" <no**********@planet.nl> wrote in message news:%2****************@tk2msftngp13.phx.gbl... Hi Simon,
Simple answer, planned in next version of VB.net, so now only C
versions, (I do not know about J#)
I hope this helps?
Cor Is there anyway to override operators (+,- etc) in VB .NET or is this only possible through C#?
Many thanks for your help,
This is the approach I have taken, but its reassuring that you have
mentioned it too.
My thoughts were that my UInt32 class etc can then easily be replaced when I
upgrade to Whidbey.
Best Wishes
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk www.headfirst.co.uk www.callofcthulhu.com
-
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:e6*************@TK2MSFTNGP10.phx.gbl... Simon, Have you considered using C# for all your UInt32 work, at least until Whidbey ships. Then calling the C# class library from VB.NET? In other words encapsulate all the unsigned logic in C# classes...
Alternatively depending on how I am actually using the UInt32, I will simply use an Integer (which is fully supported) any place I would have used a UInt32...
Hope this helps Jay
"Simon Jefferies" <si****@headfirst.co.uk> wrote in message news:u6**************@TK2MSFTNGP11.phx.gbl... Thanks for your reply,
Trying to get around the System.UInt32 not having the +/- operators. Its a bit tedious having to do a number of conversions to perform an addition. Trying to work out a way of making to code a bit more elegant but will convert to Whidbey without many changes etc...
Regards Simon Jefferies Tools Programmer, Headfirst Productions mailto:si****@headfirst.co.uk www.headfirst.co.uk www.callofcthulhu.com - "Cor Ligthert" <no**********@planet.nl> wrote in message news:%2****************@tk2msftngp13.phx.gbl... > Hi Simon, > > Simple answer, planned in next version of VB.net, so now only C versions, > (I > do not know about J#) > > I hope this helps? > > Cor >> Is there anyway to override operators (+,- etc) in VB .NET or is this >> only >> possible through C#? > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Nicodemus |
last post by:
Hi all,
I found a surprising behavior regarding new-style classes operator lookup.
It seems that for operators, the instance methods are ignored. Observe:
>>> class C:
.... def foo(self):...
|
by: Andrew Durdin |
last post by:
In Python, you can override the behaviour of most operators for a
class, by defining __add__, __gt__, and the other special object
methods.
I noticed that, although there are special methods for...
|
by: Andrew Durdin |
last post by:
On Fri, 20 Aug 2004 23:28:20 -0700, Robert Brewer <fumanchu@amor.org> wrote:
>
> The first barrier is that 'or' and 'and' get compiled down to jump
> codes, as opposed to operations:
>...
|
by: Edward Diener |
last post by:
Is it possible for a derived class to override a property and/or event of
its base class ?
|
by: Cheng Mo |
last post by:
When overriding operator new & delte of one class, the method is
implicitly declared as static. However, overriding operator new & delete
of template cannot be static.The compiler says cannot...
|
by: Gonçalo Rodrigues |
last post by:
Hi all,
I have a base class, call it Object, that implements operators new and
delete.
Now suppose there is also a class, call it Derived, deriving from
Object. It has the feature that *all*...
|
by: JohnR |
last post by:
From reading the documentation, this should be a relatively easy thing. I
have an arraylist of custom class instances which I want to search with
an"indexof" where I'm passing an instance if the...
|
by: groleo |
last post by:
Hi list.
Simple question:
is it possible to override the global new/delete operators, without
using malloc/free?
I mean something in the ideea of the code below, which doesnt work
cause of...
|
by: Kenneth Baltrinic |
last post by:
When one overrides the Equals() method of an object, one is supposed to
override GetHashCode() as well and this makes good sense. But I have seen
lots of people who do this and do not override the...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |