* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / mbas / Test / tests / statements / ForEachA.vb
1 Imports System
2
3 Module M
4         Sub Main
5                 Dim a As Integer() = { 1, 2, 3}
6                 Dim b As Integer
7                 Dim c As Integer = 0
8                 For Each b In a
9                         c = c + b
10                         c = c + 1
11                 Next
12                 If c <> 9 Then
13                         Throw New Exception("#A1: count is wrong")
14                 End If
15                 c = 0
16                 For Each b In a
17                         c = c + b
18                         c = c + 1
19                         Dim d As Integer
20                         For Each d In a
21                                 c = c + d
22                         Next
23                 Next
24                 If c <> 27 Then
25                         Throw New Exception("#A2: count is wrong")
26                 End If
27         End Sub
28 End Module
29