i need to translate following C# method to the same IronPhyton method
private void GetTP(string name, out string ter, out int prov)
{
ter = 2;
prov = 1;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In python (and consequently in IronPython) you cannot change a parameter that is not mutable (like strings)
So you can’t directly traslate the given code to python, but you must do something like:
and when you call it you must do:
that is the same behaviour when in IronPython you call a C# method containing out/ref parameters.
In fact, in that case IronPython returns a tuple of out/ref parameters, and if there’s a return value is the first in the tuple.
EDIT:
actually it’s possible to override a method with out/ref parameters, look here:
http://ironpython.net/documentation/dotnet/dotnet.html#methods-with-ref-or-out-parameters