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

Does VB.NET compiler tell about not used variables?

P: n/a
Hi,

I would like to know if the VB.NET compiler could tell about not used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
I think only Whidbey has that feature.

"Marty" <xm******@hotmail.com> wrote in message
news:BQyFd.79416$nN6.7915@edtnps84...
Hi,

I would like to know if the VB.NET compiler could tell about not used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty

Nov 21 '05 #2

P: n/a
"Marty" <xm******@hotmail.com> schrieb:
I would like to know if the VB.NET compiler could tell about not used
variable? If yes, How do I set it?

Or at least display a warning like in c++.


Not yet, but there will be a warning in VB 2005 ("Whidbey").

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

P: n/a
a tool like http://www.mztools.com/v4/mztools4.htm is giving this feature.

--

HTH

Éric Moreau
MCSD, Visual Developer - Visual Basic MVP
(http://aspnet2.com/mvp.ashx?EricMoreau)
Conseiller Principal / Senior Consultant
Concept S2i inc.(www.s2i.com)
"Marty" <xm******@hotmail.com> wrote in message
news:BQyFd.79416$nN6.7915@edtnps84...
Hi,

I would like to know if the VB.NET compiler could tell about not used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty

Nov 21 '05 #4

P: n/a

Hi Marty,

In VB.net we can not get any alert for thosed variabls declared but not
used.

If you used C#, you can get alert of this type.

Better used ctr+F and search this variable name where you used it. Or
if the page is too long, just comment the declaration line , so red
lines can come in the code.

~Himadrish
Marty wrote:
*Hi,

I would like to know if the VB.NET compiler could tell about not
used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty *


--
populate
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1348739.html

Nov 21 '05 #5

P: n/a
Thanks for all your replies, very appreciated. :)

Marty

populate wrote:
Hi Marty,

In VB.net we can not get any alert for thosed variabls declared but not
used.

If you used C#, you can get alert of this type.

Better used ctr+F and search this variable name where you used it. Or
if the page is too long, just comment the declaration line , so red
lines can come in the code.

~Himadrish
Marty wrote:
*Hi,

I would like to know if the VB.NET compiler could tell about not
used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty *



--
populate
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1348739.html

Nov 21 '05 #6

P: n/a
also, search for fxcop on gotdotnet, very handy. it'll find "dead code"
(methods/vars not accessed/used) and show you all kinds of things that you
shouldn't be doing in your code ;o).

cheers.

"Marty" <xm******@hotmail.com> wrote in message
news:BQyFd.79416$nN6.7915@edtnps84...
Hi,

I would like to know if the VB.NET compiler could tell about not used
variable? If yes, How do I set it?

Or at least display a warning like in c++.

Thanks you

Marty

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.