2004-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / btests / ConditionalCompilationB.vb
1 Imports System
2 Module ConditionalCompilation
3         Sub Main()
4                 Dim value As Integer
5                 Try
6
7                         'Testing #If,#Elseif, #Else and #End If block
8                                                                                                                              
9                         #If False
10                                   Throw New Exception("#A1-Conditional Compilation :Failed")
11                         #ElseIf True
12                                 value=30
13                         #Else
14                                   Throw New Exception("#A2-Conditional Compilation :Failed")
15                         #End If
16                                                                                                                             
17                         If value<>30 Then
18                                 Throw New Exception("#A3-Conditional Compilation:Failed ")
19                         End If
20                 Catch e As Exception
21                         Console.WriteLine(e.Message)
22                 End Try
23                                                                                                                              
24                                                                                                                              
25                 'Testing nested #If and #End If Block
26                 Try                                                                                                             
27                         #If True
28                                 #If True
29                                          value=40
30                                 #End If
31                         #End If
32
33                         If value<>40
34                                 Throw New Exception("#A4-Conditional Compilation:Failed ")
35                         End If
36                 Catch e As Exception
37                         Console.WriteLine(e.Message)
38                 End Try
39         End Sub
40 End Module