473,396 Members | 1,892 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,396 software developers and data experts.

Does VB.NET compiler tell about not used variables?

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
6 1336
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
"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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
1
by: terrencel | last post by:
I was told to look at some old C code that was ported to C++. One of the file is like: ========================================= CPPClass* someCPPVar = NULL; extern "C" {
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
51
by: Tony Sinclair | last post by:
I'm just learning C#. I'm writing a program (using Visual C# 2005 on WinXP) to combine several files into one (HKSplit is a popular freeware program that does this, but it requires all input and...
19
by: David W | last post by:
float nanometers(long pm) { return pm / 1000.0f; } void f() { if(nanometers(309311L) == nanometers(309311L)) { // do something }
49
by: valentin tihomirov | last post by:
fDeleted = false; uint jobId; foreach (Struct struct in structures) { if (struct.type == JOB) { jobId = struct.id; if (struct.dataType == STATUS) fDeteted = (struct.data & STATUS_DELETED) !=...
18
by: andreas.luethi | last post by:
Hi All Compile a our source with BM XL C/C++ Enterprise Edition V8.0 for AIX (Version: 08.00.0000.0000) produces a lot of Informational message like this: "aaalib.c", line 671.1: 1506-412 (I)...
45
by: Bob Altman | last post by:
This code (Visual Studio 2005) should generate a compilation warning to the effect that I'm accessing a shared member through an instance variable (the "color" variable): Private Sub X(ByVal...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.