MVP·VB Classic,VB.NET < http://www.mvps.org/dotnet> < http ://www.plig.net/nnq/nquote.html> 嗨Cal, 是。 问候, Fergus 没有VB等价于null吗?如果本书是为C#编写的,是的。但是没有什么也适用于价值类型。 不确定这意味着什么。以下是正确的吗? 这是否意味着我可以将对象变量设置为null或Nothing, 而整数变量可以设置为Nothing但是不要为了 将整数变量设置为与将其设置为零无关? 将对象变量设置为null意味着它不引用对象? - Herfried K. Wagner MVP·VB Classic,VB.NET < http://www.mvps.org/dotnet> < http://www.plig.net/nnq/nquote.html> Help for a method says it may return null.An example in a book using that method checked the return against Nothing.Is Nothing the VB equivalent of null?ThanksCal 解决方案 * "Cal" <ac****@REMOVEa-znet.com> scripsit: Help for a method says it may return null. An example in a book using that method checked the return against Nothing. Is Nothing the VB equivalent of null?If the book is written for C#, yes. But ''Nothing'' will work for valuetypes too.--Herfried K. WagnerMVP · VB Classic, VB.NET<http://www.mvps.org/dotnet><http://www.plig.net/nnq/nquote.html>Hi Cal,Yes.Regards,Fergus Is Nothing the VB equivalent of null? If the book is written for C#, yes. But ''Nothing'' will work for value types too.Not sure what that means. Is the following correct?Does it mean I can set an object variable to null or to Nothing,while an integer variable can be set to Nothing but not to nullIs setting an integer variable to nothing the same as setting it to zero?Setting an object variable to null means it does not reference an object? -- Herfried K. Wagner MVP · VB Classic, VB.NET <http://www.mvps.org/dotnet> <http://www.plig.net/nnq/nquote.html> 这篇关于null vs Nothing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 20:01