A string is handled a little differently. You can not just set the scoping
as ByRef because strings are immutable. Thus when you change the string, the
reference to the new string inside of the function is changed, but the
reference pointer in the calling method is not changed. You need to pass a
stringbuilder rather than a simple string if you want to manipulate the
return values inside of a sub.
The method declaration you provided seems to indicate that you don't need a
function and could do with a simple method call as in:
Sub prc0(ByRef EditableString as StringBuilder)
Alternatiely, could you alter your calls to have a function that returned a
string rather than changes the mathod's parameters as in:
Function prc0(inString as string) as String
return inString & " is altered"
End Function
The calling method then would be:
MyString = prc0(MyString)
Just some food for thought.
Jim Wooley
"Joe" <jo*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,
I like to know what do you specify in the function parameter (in the
function implementation) if you want the string that you pass in with the
function call to be changed while its in the function and then you get it
back changed as well?
Is it ByRef or just notthing
function prc0(ByRef editablestring as string )
or
function prc0(editablestring as string )