* Mono.Posix.dll.sources: Rename Mono.Posix to Mono.Unix.
[mono.git] / mcs / mbas / Test / errors / Function_ParamArrayC1.vb
1 REM LineNo: 25
2 REM ExpectedError: BC30192
3 REM ErrorMessage: ParamArray parameter must be last in parameter list.
4
5 REM LineNo: 29
6 REM ExpectedError: BC30451
7 REM ErrorMessage: Name 'args1' is not declared.
8
9 REM LineNo: 40
10 REM ExpectedError: BC30311
11 REM ErrorMessage: Value of type '1-dimensional array of Integer' cannot be converted to 'Integer'.
12
13 REM LineNo: 40
14 REM ExpectedError: BC30311
15 REM ErrorMessage: Value of type '1-dimensional array of Integer' cannot be converted to 'Integer'.
16
17 '============================================================================================
18 'Name:Manish Kumar Sinha 
19 'Email Address: manishkumarsinha@sify.com
20 'Test Case Name: ParamArray:
21 '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 
22 '=============================================================================================
23 Imports System
24 Module PA_1_0_0
25    Function F(ParamArray args() As Integer,ParamArray args1() As Integer)as Boolean
26       Dim a as integer
27         Dim b as integer
28         a = args.Length
29         b = args1.Length
30         if a<>b
31         return true
32         else 
33         return false
34         end if
35    End Function
36    Sub Main()
37       Dim a As Integer() = { 1, 2, 3 }
38         Dim b As Integer() = { 1, 2, 3,4 }
39       Dim e as Boolean
40         e= F(a,b)
41         if e<>true
42                 Throw New System.Exception("#A1, Unexcepted Behaviour in F(a,b)")
43         end if
44    End Sub
45 End Module
46 '=============================================================================================