(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / mbas / Test / tests / WithStatementB.vb
blob735d7f26c4ccfcd8a62be6ed19abe1b7659cb972
1 Imports System
4 Module WithStatementB
5 Class C1
6 Public a1 As Integer = 10
7 Friend a2 As String = "Hello"
8 Sub f1()
9 Console.WriteLine("Class C1: {0} {1}", a1, a2)
10 End Sub
11 End Class
13 Sub main()
14 Dim a As New C1()
15 With a
16 a.a1 = 20
17 .a2 = "Hello World"
18 Dim x As New C1()
19 a = x ' Tried reassiging the object inside With statement
20 If .a1 = a.a1 Or .a2 = a.a2 Then
21 Throw New Exception("#WS1 - With Statement failed")
22 End If
23 a.f1()
24 .f1()
25 End With
27 End Sub
29 End Module