Add new error case
[mono.git] / mcs / btests / LoopStatementsA.vb
1 Imports System\r
2 \r
3 Module LoopStatementsA\r
4 \r
5     Sub main()\r
6         Dim index As Integer = 0\r
7         Dim count As Integer = 0\r
8 \r
9         Do\r
10             count += 1\r
11             index = 0\r
12             While index <> 4\r
13                 index += 1\r
14             End While\r
15             If index <> 4 Then\r
16                 Throw New Exception("#LSA1 - Loop Statement failed")\r
17             End If\r
18 \r
19             Do While index < 10\r
20                 index += 1\r
21                 If index = 8 Then\r
22                     Exit Do\r
23                 End If\r
24             Loop\r
25             If index <> 8 Then\r
26                 Throw New Exception("#LSA2 - Loop Statement failed")\r
27             End If\r
28 \r
29             Do\r
30                 index += 1\r
31             Loop While index < 12\r
32             If index <> 12 Then\r
33                 Throw New Exception("#LSA3 - Loop Statement failed")\r
34             End If\r
35 \r
36             Do Until index <= 8\r
37                 index -= 1\r
38             Loop\r
39             If index <> 8 Then\r
40                 Throw New Exception("#LSA4 - Loop Statenment failed")\r
41             End If\r
42 \r
43             Do\r
44                 index -= 1\r
45                 If index = 4 Then\r
46                     Exit Do\r
47                 End If\r
48             Loop Until index <= 3\r
49             If index <> 4 Then\r
50                 Throw New Exception("#LSA5 - Loop Statenment failed")\r
51             End If\r
52 \r
53             If count = 2 Then\r
54                 Exit Do\r
55                 Exit Do\r
56             End If\r
57 \r
58         Loop\r
59 \r
60     End Sub\r
61 \r
62 End Module