Does VB.NET compiler tell about not used variables?

  • Thread starter Thread starter Marty
  • Start date Start date
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
 
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").
 
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
 
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.
 
Back
Top