(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / mbas / Test / tests / Function_ParamArrayB.vb
blobea2d5441780a1e9066d11983a10fd1b385b40b8a
1 '============================================================================================
2 'Name:Manish Kumar Sinha
3 'Email Address: manishkumarsinha@sify.com
4 'Test Case Name: ParamArray:
5 '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
6 '=============================================================================================
7 Imports System
8 Module PA_1_0_0
9 Function F(ParamArray args() As Integer)as Integer
10 Dim a as integer
11 a = args.Length
12 return a
13 End Function
14 Sub Main()
15 Dim a As Integer() = { 1, 2, 3 }
16 Dim b as Integer
17 b= F(a)
18 if b<>3
19 Throw New System.Exception("#A1, Unexcepted Behaviour in F(a)")
20 end if
22 b = F(10, 20, 30, 40)
23 if b<>4
24 Throw New System.Exception("#A2, Unexcepted Behaviour in F(10,20,30,40)")
25 end if
26 b = F()
27 if b<>0
28 Throw New System.Exception("#A3, Unexcepted Behaviour in F()")
29 end if
30 End Sub
31 End Module
32 '=============================================================================================