* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / mbas / Test / tests / general / LocalVariablesA.vb
1 Imports System
2
3 Module LocalVariablesA
4
5     Function swap(ByVal a As Integer, ByVal b As Integer) As Integer
6         Dim c As Integer
7         c = a
8         a = b
9         b = c
10         Return 0
11     End Function
12
13     ' Local variable having same name as Sub containing it
14     Sub f2()
15         Dim f2 As Integer = 1
16         f2 = f2 + 1
17           if f2<>2      
18                 throw new System.Exception("#A1 Local Variables not working")
19           end if
20     End Sub
21
22     Sub main()
23         Dim a, b As Integer
24         a = 10 : b = 32
25           if a<>10 and b<>32     
26                 throw new System.Exception("#A2 Local Variables not working")
27           end if
28         swap(a, b)
29         if a<>10 and b<>32      
30                 throw new System.Exception("#A3 Local Variables not working")
31           end if
32         f2()
33     End Sub
34
35 End Module