Passing Arguments with ByVal and ByRef
Private Sub Main()
Dim num1 As Integer
Dim num2 As Integer
num1 = 10
num2 = 20
Call PassByValue(num1)
Call PassByReference(num2)
MsgBox num1 & " " & num2
End Sub
Private Sub PassByValue(ByVal num1 As Integer)
num1 = num1 ^ 2
End Sub
Private Sub PassByReference(num3 As Integer)
num3 = num3 ^ 2
End Sub
Related examples in the same category