I ran the following code expecting the form's caption to be set to 10, but instead it was set to 5. Evidently i was passed byval instead of byref.

private Sub Command1_Click()
Dim i as Integer
i = 5
setToTen (i)
me.Caption = i
End Sub

Sub setToTen(byref n as Integer)
n = 10
End Sub




I'm using Windows 2000 Professional with VB6 (service pack 5). Does the above code pass the parameter by reference on other platforms?