2 REM ExpectedError: BC30046
3 REM ErrorMessage: Method cannot have both a ParamArray and Optional parameters.
6 REM ExpectedError: BC30451
7 REM ErrorMessage: Name 'args' is not declared.
10 REM ExpectedError: BC30451
11 REM ErrorMessage: Name 'args' is not declared.
14 REM ExpectedError: BC30311
15 REM ErrorMessage: Value of type '1-dimensional array of Integer' cannot be converted to 'Integer'.
18 REM ExpectedError: BC30057
19 REM ErrorMessage: Too many arguments to 'Public Sub F([length As Integer = 3])'.
21 '============================================================================================
22 'Name:Manish Kumar Sinha
23 'Email Address: manishkumarsinha@sify.com
24 'Test Case Name: Optional argument:
25 'APR-1.0.0: ParamArray and Optional can be used together
26 '=============================================================================================
31 Sub F(Optional ByVal length
as Integer = 3 , ParamArray
args() As Integer )
32 Console
.Write("Array contains " & args
.Length
& " elements:")
33 if (args
.Length
<> length
)
34 Throw
New System
.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")
38 Dim a
As Integer() = { 1, 2, 3 }
44 '=============================================================================================