[IronPython] Passing a reference to a string

Michael Foord fuzzyman at voidspace.org.uk
Tue Jun 19 19:20:56 CEST 2007


John Barham wrote:
> I'm trying to call a C# method from IP that takes a reference to a
> string as one of its parameters.  I'm passing it a System.String()
> object, but the string is not changed after I call the method.  I know
> that CPython (and presumably IP) strings are immutable so how do I get
> C# to change the string object that I pass in?
>   
Is it an out argument or a ref argument?

out arguments are returned as an extra return value from the call with 
IronPython. refs need to be constructed using a 'ref' constructor 
somewhere in the IronPython API...

Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml

> Thanks,
>
>   John
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>   




More information about the Ironpython-users mailing list