|
-
March 2nd, 2001, 07:33 PM
#1
parameter not passed byref
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|