Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option VBASupport 1
- Option Explicit
- Sub Main
- Dim y As Double
- y = 10
- halve1 y
- MsgBox " y = " & y
- End
- Sub halve1(ByVal x As Double) 'copies the value of y into x but doesn't change the value of x
- x = x/2
- End Sub
- Sub halve2(ByRef c As Double) 'x as the re3ference but changes the value of y
- x = x/2
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement