G
Guest
I've inherited code similar to the following with a comment on resetting the
string. Why would anyone want to do this? How could this reset the string?
What does it mean to reset a string?
Public Sub SetTheStringToSomething(ByRef OutStr As String)
OutStr = "123"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim s As String
SetTheStringToSomething(s)
Dim sOriginal$ = s
s = sOriginal 'reset the string ' <- why? how?
Debug.WriteLine(s)
Debug.WriteLine(sOriginal)
End Sub
string. Why would anyone want to do this? How could this reset the string?
What does it mean to reset a string?
Public Sub SetTheStringToSomething(ByRef OutStr As String)
OutStr = "123"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim s As String
SetTheStringToSomething(s)
Dim sOriginal$ = s
s = sOriginal 'reset the string ' <- why? how?
Debug.WriteLine(s)
Debug.WriteLine(sOriginal)
End Sub