Perhaps a simple question, but I am having problems finding the answer. I am
hosting IronPython (1.1.1) in a C# application. My IronPython method
modifies the parameters passed to the method (out int). I would very much
like to get those modified values back. Here is my sample:
//C# method that calls the PythonEngine:
PythonEngine pe = new PythonEngine();
EngineModule em = pe.CreateModule("PreCalc",true);
string[] paramnames = {"number1", "number2"};
PreCalcMacro pcMac =
pe.CreateMethod<PreCalcMacro>(GetPreCalcSourceUnitString(), paramnames, em);
pcMac(out firstNumber, out secondNumber);
Number1TextBox.Text = firstNumber.ToString();
Number2TextBox.Text = secondNumber.ToString();
//My delegate definition:
delegate void PreCalcMacro(out int n1, out int n2);
//My IronPython code (the return value of GetPreCalcSourceUnitString() ):
number1 = 2
number2 = 3
Now, after this code executes, the values of firstNumber and secondNumber
remain unchanged.
What do I need to do to have these values update to what the python method
set them to?
Thanks!
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com