"katzky" <ka****@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
My VB6 application has some properties which are set ByRef but upgrade to
ByVal. [I read in the documentation that Property SET ByRef is not
allowed
in VB.Net] How can I assure that the new code behaves the same as the
old?
How did the old code behave? The only reason I can think of to support ByRef
property assignments would be for array support.
Were you manipulating the values before returning in VB6? If so, that
doesn't seem to work in VB6 either....
'======
Option Explicit
Private msTest As String
Public Property Get Test() As String
Test = msTest
End Property
Public Property Let Test(ByRef Setting As String)
msTest = Setting
'attempt to manipulate the ByRef variable
Setting = "Property has been set"
End Property
Private Sub Form_Load()
Dim s As String
s = "This is a test"
Test = s
'shows "This is a test", instead of the expected "Property has been set"
Debug.Print s
End Sub
'======
--
Ken Halter - MS-MVP-VB (visiting from VB6 world) -
http://www.vbsight.com
Please keep all discussions in the groups..