**** Merged from MCS ****
[mono-project.git] / mcs / mbas / Test / tests / FunctionArgu_ByReferenceB.vb
blob33c4396e07a2957130c582c064dd55e77a6d32d9
1 '=============================================================================================
2 'Name:Manish Kumar Sinha
3 'Email Address: manishkumarsinha@sify.com
4 'Test Case Name: Argument passing by Reference:
5 'APR-1.4.0: If procedure is define by passing argument by reference and while calling the
6 ' procedure it is passes by giving parentheses around the variable then it protect
7 ' it from change
8 '=============================================================================================
10 Imports System
11 Module APR_1_4_0
12 Function F(ByRef p As Integer) as Integer
13 p += 1
14 return p
15 End Function
17 Sub Main()
18 Dim a As Integer = 1
19 Dim b As Integer = 0
20 b=F((a))
21 if(b=a)
22 Throw new System.Exception ("#A1, Unexpected behavior in Arguments_ByReferenceB.vb")
23 end if
24 End Sub
25 End Module
26 '=============================================================================================