**** Merged from MCS ****
[mono-project.git] / mcs / mbas / Test / errors / Function_ParamArrayC3.vb
blob3862ff5c8fff026306c3e886b62b8ae84acbf311
1 REM LineNo: 21
2 REM ExpectedError: BC30192
3 REM ErrorMessage: ParamArray parameter must be last in parameter list.
5 REM LineNo: 24
6 REM ExpectedError: BC30451
7 REM ErrorMessage: Name 'b' is not declared.
9 REM LineNo: 35
10 REM ExpectedError: BC30311
11 REM ErrorMessage: Value of type '1-dimensional array of Integer' cannot be converted to 'Integer'.
13 '============================================================================================
14 'Name:Manish Kumar Sinha
15 'Email Address: manishkumarsinha@sify.com
16 'Test Case Name: ParamArray:
17 'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure
18 '=============================================================================================
19 Imports System
20 Module PA_1_0_0
21 Function F(ParamArray args() As Integer, ByVal b as Integer)as Boolean
22 Dim a as integer
23 a = args.Length
24 if a=b
25 return true
26 else
27 return false
28 end if
29 End Function
30 Sub Main()
31 Dim a As Integer() = { 1, 2, 3 }
32 Dim c as Integer
33 c = a.Length
34 Dim b as Boolean
35 b= F(a,c)
36 if b<>true
37 Throw New System.Exception("#A1, Unexcepted Behaviour in F(a,c)")
38 end if
39 End Sub
40 End Module
41 '=============================================================================================