jskfan
asked on
Byref and Byval
I would like someone to give me a simple and clear illustration of using Byval and Byref in VB example.
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks, your example is much more simple and clear.
ASKER
Private Sub calculatesum(ByVal numb1 As Integer, ByVal numb2 As Integer, ByVal totalsum As Integer)
totalsum = totalsum + numb1 + numb2
MsgBox(totalsum)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim x, y, z
x = 5
y = 5
z = 7
Me.calculatesum(x, y, z)
MsgBox(x)
MsgBox(y)
MsgBox(z)
End Sub