真正的未使用变量?!? [英] Unused variables that really are?!?

查看:99
本文介绍了真正的未使用变量?!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,在我正在研究的VB2005项目中,几个变量显示警告列表中的
是未使用的局部变量。但他们都是b $ b。其中有几个是Try / Catch中使用的ex变量,并且每个Catch为每个引用异常变量的
。然而它仍然被标记为未使用的
?给出了什么?

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 Try/Catch, and
the Catch for each one references the ex exception variable. Yet it is
still flagged as unused? What gives?

推荐答案

您是否在catch块中引用异常变量?我猜是没有
,这就是为什么它被标记为awy。


< za *** @ construction-imaging.com>在消息中写道

news:11 ********************** @ g49g2000cwa.googlegr oups.com ...
Are you referencing the exception variable in the catch block? I am guessing
not, which is why it is flagged that awy.

<za***@construction-imaging.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
突然,在我正在研究的一个VB2005项目中,几个变量显示在警告列表中是未使用的局部变量。但他们都是。其中有几个是Try / Catch中使用的ex变量,并且每个Catch都引用了ex异常变量。然而它仍被标记为未使用?给出了什么?
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 Try/Catch, and
the Catch for each one references the ex exception variable. Yet it is
still flagged as unused? What gives?



< za *** @ construction-imaging.com> schrieb:
<za***@construction-imaging.com> schrieb:
突然,在我正在研究的一个VB2005项目中,几个变量显示在警告列表中是未使用的局部变量。但他们都是。其中有几个是Try / Catch中使用的ex变量,并且每个Catch都引用了ex异常变量。然而它仍被标记为未使用?什么给出了?
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 Try/Catch, and
the Catch for each one references the ex exception variable. Yet it is
still flagged as unused? What gives?




我无法用你最终版本的VS

2005重新描述你所描述的问题。你用的?问题是否发生在新建的

创建的项目中?你可以发布你正在使用的代码吗?也许删除

项目的bin和obj文件夹和重新编译解决了这个问题。


-

MS Herfried K. Wagner

MVP< URL:http:/ /dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



I''m not able to repro the problem you describe with the final version of VS
2005. Which veryion are you using? Does the problem even occur in a newly
created project? Could you post the code you are using? Maybe deleting the
project''s "bin" and "obj" folders and recompiling solves the problem.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Zacks,

Zacks,

突然,在我正在研究的VB2005项目中,几个变量显示在警告列表中是未使用的局部变量。但他们都是。其中有几个是Try / Catch中使用的ex变量,并且每个Catch都引用了ex异常变量。然而它仍被标记为未使用?什么给出了?
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 Try/Catch, and
the Catch for each one references the ex exception variable. Yet it is
still flagged as unused? What gives?



这是一个新功能,我们中的一些人(Herfried和我)不是完全喜欢的b $ b。


(据我所知,顺便说一下它是否正确,但是它没有

知道你作为人类知道某些情况不可能存在)。


不要试图像这样创建结构。


dim mystring as string =""。


这只是开销。


Cor


It is a new feature what some of us by instance (Herfried and I) are not
completly fond of.

(As far as I have seen does it work correct by the way, however it does not
know that you as human know that some situations cannot exist).

Do not try to create constructions as this.

dim mystring as string = "".

This gives only overhead.

Cor


这篇关于真正的未使用变量?!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆