By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

C# shows error why not VB?

P: n/a
C#
In Function or Property, if you don't return a value, the IDE gives you an
error "Function does not return a value"

VB
Does nothing
Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
similar items to be Fixed:

Not all code paths are hit.
Variable is never used.

All I can think of right now...

I develop in C# at work so I see these things....

I'm surprised, this is the kind of things I would expect to see in C#. Most
C# programmers have no idea what VB.NET/IDE features they are missing...

Are they fixing this in the latest releases?

Thanks,

Schneider
"schneider" <00**@0000.SPAM> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
C#
In Function or Property, if you don't return a value, the IDE gives you an
error "Function does not return a value"

VB
Does nothing
Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider

Nov 20 '05 #2

P: n/a
Hi Scheider,

Because that Herfried is not active some days, I write it for him, that he
finds very bad and he never forgets to add that to this kind of messages.

However searching for all those answers about this from him I found this.

http://www.google.com/gr************...TNGP10.phx.gbl

I found that a very nice answer.

Cor
Nov 20 '05 #3

P: n/a
schneider,
As Cor stated, VS.NET 2005 (aka Whidbey, due out in 2005) has added support
for most or all of these warnings.

Note, I really don't see that VB.NET is "broken" per se so I don't really
consider any thing being "fixed" in the next version.

For information on VS.NET 2005 & to download a beta copy see:

http://lab.msdn.microsoft.com/vs2005/

Hope this helps
Jay

"schneider" <00**@0000.SPAM> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
C#
In Function or Property, if you don't return a value, the IDE gives you an
error "Function does not return a value"

VB
Does nothing
Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider

Nov 20 '05 #4

P: n/a
> schneiderwrote:
C#
In Function or Property, if you don't return a value, the IDE gives you an error "Function does not return a value"

VB
Does nothing
Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider


It's not broken because VB automatically returns the default value of
the method return type if you haven't explicity set it. C# does not
attempt this.

Nov 20 '05 #5

P: n/a
Yes I forgot about the Function thing.
Although i think its bad practice to us the function name. If you rename the
function it causes problems. And if Option Explicite if Off even harder.

Anyway C# all has the message "Variable is never set/used".

All I'm saying is C# does a few thing better, to prevent errors.

Hopefully it's all there in the new release..

This would be a good check for FXcop....

Schneider
"David Anton" <da**@tangiblesoftwaresolutions-dot-com.no-spam.invalid> wrote
in message news:41**********@Usenet.com...
schneiderwrote:

C#
In Function or Property, if you don't return a value, the IDE gives

you an
error "Function does not return a value"

VB
Does nothing
Anyone going to fix this (MS) ?

There's also several other cases like this....

Thanks,

Schneider


It's not broken because VB automatically returns the default value of
the method return type if you haven't explicity set it. C# does not
attempt this.

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.