1: Private Sub test(a As Integer, ByVal b As Integer, ByRef c As Integer)
2: a = a + 1
3: b = b + 1
4: c = c + 1
5: End Sub
6: Private Sub Form_Load()
7: Dim a As Integer, b As Integer, c As Integer
8: a = 1
9: b = 1
10: c = 1
11: test a, b, c
12: Debug.Print a
13: Debug.Print b
14: Debug.Print c
15: End Sub
1: Private Sub test(ByVal a As Integer, ByVal b As Integer, ByRef c As Integer)
2: a = a + 1
3: b = b + 1
4: c = c + 1
5: End Sub
6:
7: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8: Dim a As Integer, b As Integer, c As Integer
9: a = 1
10: b = 1
11: c = 1
12: test(a, b, c)
13: Trace.WriteLine(a)
14: Trace.WriteLine(b)
15: Trace.WriteLine(c)
16: End Sub
1: Private Sub test(ByRef a As String)
2: a = a & "!"
3: Debug.Print a
4: End Sub
5:
6: Private Sub Form_Load()
7: test Me.Caption
8: Debug.Print Me.Caption
9: End Sub
1: Private Sub test(ByRef a As String)
2: a = a & "!"
3: Trace.WriteLine(a)
4: End Sub
5:
6: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
7: test(Me.Text)
8: Trace.WriteLine(Me.Text)
9: End Sub
1: Private Sub test(ParamArray a() As Variant)
2: a(0) = a(0) + 1
3: Debug.Print a(0)
4: End Sub
5:
6: Private Sub Form_Load()
7: Dim a As Integer
8: a = 1
9: test a
10: Debug.Print a
11: End Sub
1: Private Sub test(ByVal ParamArray a() As Object)
2: a(0) = a(0) + 1
3: Trace.WriteLine(a(0))
4: End Sub
5:
6: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
7: Dim a As Integer
8: a = 1
9: test(a)
10: Trace.WriteLine(a)
11: End Sub
1: Private Sub test(ByVal ParamArray a() As Integer)
2: a(0) = a(0) + 1
3: Trace.WriteLine(a(0))
4: End Sub
5:
6: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
7: Dim a As Integer
8: a = 1
9: test(a)
10: Trace.WriteLine(a)
11: End Sub