expressionliteralnothingb.vb

来自「大名鼎鼎的mono是.NET平台的跨平台(支持linux」· VB 代码 · 共 24 行

VB
24
字号
'Author: Ritvik Mayank <mritvik@novell.com>'Copyright (C) 2005 Novell, Inc (http://www.novell.com)'Nothing keyword represents the default value of any data typeImports SystemImports Microsoft.VisualBasicModule ExpressionLiteralsNothing    Public Structure MyStruct        Public Name As String        Public Number As Short    End Structure    Function Main() As Integer        Dim A As MyStruct        A = Nothing        If A.Name <> Nothing Then            System.Console.WriteLine("Unexpected behavior. A.Name Should be Nothing ") : Return 1        End If        If A.Number <> 0 Then            System.Console.WriteLine("Unexpected behavior. A.Number Should be 0 ") : Return 1        End If    End FunctionEnd Module

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?