Does VB.NET compiler tell about not used variables?

M

Marty

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
 
H

Herfried K. Wagner [MVP]

Marty said:
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").
 
P

populate

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
 
C

ChipOne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top