473,378 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Unused Variables

Is there a way to scan a project and find the variables that have been
declared but never used? I'm fixing someone else's code and it filled with
these things!

Thanks.
Nov 18 '05 #1
4 1181
If you're using Visual Studio.Net, yes. It will tell you every time you
compile. It just won't alert you.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Is there a way to scan a project and find the variables that have been
declared but never used? I'm fixing someone else's code and it filled with these things!

Thanks.

Nov 18 '05 #2
> It will tell you every time you compile.

I believe this applies only to C#.
For VB.NET you may need a 3rd party tool.

I hope this helps,
Steve C. Orr,
MCSD, MVP in ASP.NET
http://Steve.Orr.net
Nov 18 '05 #3
It should appear in the Task List. I must admit I don't use VB.Net very
often, but I believe it is there. Correct me, please, if I'm wrong.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OC**************@TK2MSFTNGP14.phx.gbl...
It will tell you every time you compile.


I believe this applies only to C#.
For VB.NET you may need a 3rd party tool.

I hope this helps,
Steve C. Orr,
MCSD, MVP in ASP.NET
http://Steve.Orr.net

Nov 18 '05 #4
It doesn't show up in the task list, nor the Output window when you build
the project. Any other suggestions? I vaguely recall there being a menu
option in the old visual studio...but it's been a long time since I've
traveled that path.... (PS I am using VB)
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It should appear in the Task List. I must admit I don't use VB.Net very
often, but I believe it is there. Correct me, please, if I'm wrong.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OC**************@TK2MSFTNGP14.phx.gbl...
> It will tell you every time you compile.


I believe this applies only to C#.
For VB.NET you may need a 3rd party tool.

I hope this helps,
Steve C. Orr,
MCSD, MVP in ASP.NET
http://Steve.Orr.net


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy...
4
by: artooro | last post by:
Hi, I'm using some lines of code like this: ClassName *var = new ClassName(...); and that's it. The class constructor does everything I want (there are methods to do more but I don't need...
7
by: ralphNOSPAM | last post by:
Is there a PHP script that can find unused variables? I'd like to 'clean up' my scripts. Thanks...
11
by: Michael B Allen | last post by:
Is there a standard method for supressing warnings regarding unused parameters? I have a function that might be called hundreds of thousands of times that looks like this: const void *...
12
by: zacks | last post by:
Suddenly, in a VB2005 project I am working on, several variables show up in the list of warnings are being unused local variables. But they all are. Several of them are the ex variable used in a...
2
by: skip | last post by:
At work we have a fairly large application (about 20 packages, 300+ modules) that looks like we might be heading into a bit of a plateau stage. Now seems like a good time to identify and delete...
8
by: Frank Rizzo | last post by:
Is there a setting in VS2005 to quickly locate methods that are unused (maybe through compiler warnings)? If not, any utilities out there that do that? Thanks
9
by: werasm | last post by:
Hi all, I'm looking for a nice clean (portable) way to get rid of unused variable warnings without fiddling with compiler settings (on a per case basis). I've come up with this: template...
10
by: Joris Dolderer | last post by:
Hello, I want to compile and link a program statically against the dietlibc. Of course, the dietlibc includes functions my program never needs. Is there any way to throw them out of the final...
13
by: Rex Mottram | last post by:
I'm using an API which does a lot of callbacks. In classic callback style, each routine provides a void * pointer to carry user-defined data. Sometimes, however, the user-defined pointer is not...
0
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.