检查是否没有 [英] Check if is nothing

查看:73
本文介绍了检查是否没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有以下内容:

如果MyTag什么都没有那么

...

结束如果


我收到错误。


MyTag的类型为HtmlTextWriterTag


私人MyTag作为HtmlTextWriterTag


我如何检查是否给了MyTag一个值?


谢谢,
Miguel

Hello,

I have the following:
If MyTag Is Nothing Then
...
End If

I am getting an error.

MyTag is of type HtmlTextWriterTag

Private MyTag As HtmlTextWriterTag

How can I check if a value was given to MyTag or not?

Thanks,
Miguel

推荐答案

如果IsNothing(MyTag)那么

。 。 。

结束如果


" shapper" < md ***** @ gmail.com写信息

新闻:11 ********************** @ u30g2000hsc。 googlegr oups.com ...
If IsNothing(MyTag) Then
. . .
End If

"shapper" <md*****@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...

您好,


我有以下内容:

如果MyTag什么都没有那么

...

结束如果


我收到错误。


MyTag的类型为HtmlTextWriterTag


私有MyTag为HtmlTextWriterTag


如何检查MyTag是否有值是不是?


谢谢,

Miguel
Hello,

I have the following:
If MyTag Is Nothing Then
...
End If

I am getting an error.

MyTag is of type HtmlTextWriterTag

Private MyTag As HtmlTextWriterTag

How can I check if a value was given to MyTag or not?

Thanks,
Miguel



使用x =无对于值类型和x Is Nothing对于引用类型。

如果将x设置为默认值,则返回true。 (另外一个

复杂功能是你可以同时使用两个字符串,但这是另一天

的故事。)

-

David Anton
www.tangiblesoftwaresolutions.com

即时C#:VB到C#转换器

即时VB:C#到VB转换器

C ++到C#转换器:将C ++转换为C#

即时C ++:将C#或VB转换为C ++ / CLI

" shapper"写道:
Use "x = Nothing" for value types and "x Is Nothing" for reference types.
This will return true if x is set to it''s default value. (a further
complication is that you can use both for strings, but that''s a story for
another day).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
"shapper" wrote:

您好,


我有以下内容:

如果MyTag什么都没有那么

...

结束如果


我收到错误。


MyTag的类型为HtmlTextWriterTag


Private MyTag As HtmlTextWriterTag


我如何检查是否给了MyTag一个值?


谢谢,

Miguel

Hello,

I have the following:
If MyTag Is Nothing Then
...
End If

I am getting an error.

MyTag is of type HtmlTextWriterTag

Private MyTag As HtmlTextWriterTag

How can I check if a value was given to MyTag or not?

Thanks,
Miguel


那只是另一个形式为MyTag Is Nothing,不值得为价值工作

类型。

-

David Anton www.tangiblesoftwaresolutions.com

即时C#:VB到C#转换器

即时VB:C#到VB转换器

C ++到C#转换器:将C ++转换为C#

即时C ++:将C#或VB转换为C ++ / CLI

" Scott M."写道:
That''s just another form of "MyTag Is Nothing", which won''t work for value
types.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
"Scott M." wrote:

如果IsNothing(MyTag)那么

。 。 。

结束如果


" shapper" < md ***** @ gmail.com写信息

新闻:11 ********************** @ u30g2000hsc。 googlegr oups.com ...
If IsNothing(MyTag) Then
. . .
End If

"shapper" <md*****@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...

您好,


我有以下内容:

如果MyTag什么都没有那么

...

结束如果


我收到错误。


MyTag的类型为HtmlTextWriterTag


私有MyTag为HtmlTextWriterTag


如何检查MyTag是否有值是不是?


谢谢,

Miguel
Hello,

I have the following:
If MyTag Is Nothing Then
...
End If

I am getting an error.

MyTag is of type HtmlTextWriterTag

Private MyTag As HtmlTextWriterTag

How can I check if a value was given to MyTag or not?

Thanks,
Miguel






这篇关于检查是否没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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