(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / mbas / Test / tests / Arguments_ByValueD.vb
blob160866189edd6b96cdf60161a20196b5075a6286
1 '=============================================================================================
2 'Name:Manish Kumar Sinha
3 'Email Address: manishkumarsinha@sify.com
4 'Test Case Name: Argument passing by Value:
5 'APV-1.0.0: If the variable elements is of reference type i.e. it contain a pointers to a class
6 ' then procedure can change the members of instance to which it points
7 '==============================================================================================
9 Imports System
10 Imports System.Array
11 Module APV1_0
13 Public Sub Increase(ByVal A() As Long)
14 Dim J As Integer
15 For J = 0 To 3
16 A(J) = A(J) + 1
17 Next J
18 End Sub
19 ' ...
20 Public Sub Replace(ByVal A() As Long)
21 Dim J As Integer
22 Dim K() As Long = {100, 200, 300, 400}
23 A = K
24 For J = 0 To 3
25 A(J) = A(J) + 1
26 Next J
27 End Sub
28 ' ...
30 Sub Main()
31 Dim N() As Long = {10, 20, 30, 40}
32 Dim N1() As Long = {11, 21, 31, 41}
33 Dim N2() As Long = {100, 200, 300, 400}
34 Dim i As Integer
35 Increase(N)
36 For i=0 To 3
37 if(N(i)<>N1(i))
38 Throw new System.Exception ("#A1, Unexpected behavior in Increase function")
39 end if
40 Next i
41 i=0
42 Replace(N)
43 For i=0 To 3
44 if(N(i)=N2(i))
45 Throw new System.Exception ("#A2, Unexpected behavior in Replace function")
46 end if
47 Next i
48 End Sub
49 End Module
50 '============================================================================================