(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / mbas / Test / errors / Test.vb
blobae5a39fc03ffcc04c0ca5558dd7cae61f3249ada
1 REM LineNo: 48
2 REM ExpectedError: BC30202
3 REM ErrorMessage: 'Optional' expected.
5 REM LineNo: 49
6 REM ExpectedError: BC30815
7 REM ErrorMessage: 'name' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
9 REM LineNo: 60
10 REM ExpectedError: BC30057
11 REM ErrorMessage: Too many arguments to 'Public Function F(telephoneNo As Long, [code As Integer = 80], [code1 As Integer = 91]) As Boolean'.
13 REM LineNo: 36
14 REM ExpectedError: BC30202
15 REM ErrorMessage: 'Optional' expected.
17 REM LineNo: 37
18 REM ExpectedError: BC30815
19 REM ErrorMessage: 'name' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
21 REM LineNo: 48
22 REM ExpectedError: BC30057
23 REM ErrorMessage: Too many arguments to 'Public Function F(telephoneNo As Long, [code As Integer = 80], [code1 As Integer = 91]) As Boolean'.
25 REM LineNo: 24
26 REM ExpectedError: BC30202
27 REM ErrorMessage: 'Optional' expected.
29 REM LineNo: 25
30 REM ExpectedError: BC30815
31 REM ErrorMessage: 'name' is not declared. File I/O functionality is available in the 'Microsoft.VisualBasic' namespace.
33 REM LineNo: 36
34 REM ExpectedError: BC30057
35 REM ErrorMessage: Too many arguments to 'Public Function F(telephoneNo As Long, [code As Integer = 80], [code1 As Integer = 91]) As Boolean'.
37 '=============================================================================================
38 'Name:Manish Kumar Sinha
39 'Email Address: manishkumarsinha@sify.com
40 'Test Case Name: Argument passing by Optional Keyword:
41 'O.P-1.0.2: An Optional parameter must specify a constant expression to be used a replacement
42 ' value if no argument is specified. After Optional parameter we can't use general
43 ' parameter as ByVal or ByRef
44 '=============================================================================================
46 Imports System
47 Module OP1_0_2
48 Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1 As Integer = 091, ByRef name As String) As Boolean
49 if (code <> 080 and code1 <> 091 and name="")
50 return false
51 else
52 return true
53 end if
54 End Function
56 Sub Main()
57 Dim telephoneNo As Long = 9886066432
58 Dim name As String ="Manish"
59 Dim status as Boolean
60 status =F(telephoneNo,,,name)
61 if(status = false)
62 Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_2")
63 end if
64 End Sub
66 End Module