* MonthCalendar.cs:
[mono-project.git] / mcs / btests / WithStatementA.vb
blobb264474b148f4ce6c2e51594685e4df3c8525f99
1 Imports System
3 Module WithStatementA
4 Class C1
5 Public a1 As Integer = 10
6 Friend a2 As String = "Hello"
7 Sub f1()
8 Console.WriteLine("Class C1: {0} {1}", a1, a2)
9 End Sub
10 End Class
12 Sub main()
13 Dim a As New C1()
14 With a
15 .a1 = 20
16 .a2 = "Hello World"
17 .f1()
18 Dim x As New C1()
19 x.a1 = 2
20 With x
21 .a1 = 3
22 .a2 = "In nested With statement"
23 .f1()
24 a.a1 = 25
25 a.a2 = "Me too"
26 a.f1()
27 End With
28 End With
30 With a ' Empty With statement
31 End With
33 End Sub
35 End Module