Updated project.
[mono.git] / mcs / btests / ConditionalStatementsB.vb
1 Imports System\r
2 \r
3 Module ConditionalStatementsB\r
4 \r
5     Sub Main()\r
6 \r
7         Dim i As Integer = 0\r
8         \r
9         ' With the single-line form, it is possible to have multiple \r
10         ' statements executed as the result of an If...Then decision.\r
11 \r
12         If i = 0 Then i += 1 : i += 2 : i += 3\r
13         \r
14 \r
15         If i <> 6 Then throw new exception("#CSB1 - LineIfThenStatement failed")  _\r
16                 else i += 6 : i += 12   \r
17         \r
18         \r
19         If i <> 24 Then \r
20                 throw new exception("#CSB2 - LineIfThenStatement failed")\r
21         End If\r
22         \r
23         ' Execution of a Case block is not permitted to "fall through" to \r
24         ' next switch section\r
25 \r
26         Dim j As Integer = 0\r
27         for i = 0 To 3\r
28                 Select Case i\r
29                         Case 0\r
30                         Case 2\r
31                                 j += 2  \r
32                         Case 1\r
33                         Case 3\r
34                                 j += 3\r
35                 End Select\r
36         next\r
37 \r
38         if j <> 5 then\r
39                 throw new exception("#CSB3 - Switch Case Statement failed")\r
40         end if\r
41         \r
42     End Sub\r
43 \r
44 End Module