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