structurea.vb

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

VB
52
字号
Option Strict OffImports SystemStructure S    Dim a As String    Const b As Integer = 25    Class c    End Class    Function f(ByVal l As Long) As Long        f = l    End Function    Structure S1        Dim g As String    End StructureEnd StructureModule M    Function Main() As Integer        Dim x As S        x.a = 10        If x.a <> 10 Then            Throw New Exception("#A1, Unexpected result")        End If        Dim y As S = x        x.a = 20        If y.a <> 10 Then            Throw New Exception("#A2, Unexpected result")        End If        If x.a <> 20 Then            Throw New Exception("#A3, Unexpected result")        End If        If x.b <> 25 Then            Throw New Exception("#A4, Unexpected result")        End If        'Console.WriteLine(x.b)        If x.f(99) <> 99 Then            Throw New Exception("#A5, Unexpected result")        End If    End FunctionEnd Module

⌨️ 快捷键说明

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