2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / mbas / Test / errors / OptionalArgu_ByValueA2.vb
1 REM LineNo: 20
2 REM ExpectedError: BC30202
3 REM ErrorMessage: 'Optional' expected.
4
5 REM LineNo: 21
6 REM ExpectedError: BC30815
7 REM ErrorMessage: 'name' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
8
9 '=============================================================================================
10 'Name:Manish Kumar Sinha 
11 'Email Address: manishkumarsinha@sify.com
12 'Test Case Name: Argument passing by Optional Keyword:
13 'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement
14 '               value if no argument is specified. After Optional parameter we can't use general 
15 '               parameter as ByVal or ByRef
16 '=============================================================================================
17
18 Imports System
19 Module OP1_0_0
20         Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091, ByRef name As String)
21                 if (code <> 080 and code1 <> 091 and name="")
22                         Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")
23                 end if
24         End Sub 
25    
26    Sub Main()
27       Dim telephoneNo As Long = 9886066432
28         Dim name As String ="Manish"
29       F(telephoneNo,,name)
30    End Sub 
31
32 End Module