<div>nevermind. figured it out. (of course)</div>
<div>&nbsp;</div>
<div>need &quot;.Value&quot; on my python. So the simple python becomes:</div>
<div>number1.Value = 2<br>number2.Value = 3</div>
<div>&nbsp;</div>
<div>(duh!... looking for the&nbsp;problem in all the wrong places)<br><br></div>
<div class="gmail_quote">On Mon, Apr 7, 2008 at 6:58 PM, Patrick Burrows &lt;<a href="mailto:pburrows@gmail.com">pburrows@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>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:</div>

<div>&nbsp;</div>
<div>//C# method that calls the PythonEngine:</div>
<div>PythonEngine pe = new PythonEngine();<br>EngineModule em = pe.CreateModule(&quot;PreCalc&quot;,true); <br>string[] paramnames = {&quot;number1&quot;, &quot;number2&quot;};<br>PreCalcMacro pcMac = pe.CreateMethod&lt;PreCalcMacro&gt;(GetPreCalcSourceUnitString(), paramnames, em);<br>
pcMac(out firstNumber, out secondNumber);<br>Number1TextBox.Text = firstNumber.ToString();<br>Number2TextBox.Text = secondNumber.ToString();</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>//My delegate definition:</div>
<div><font color="#333333"><font size="2"><font size="2">delegate</font></font><font size="2"><font size="2"> </font></font><font size="2"><font size="2">void</font></font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2"> </font></font><font size="2"><font color="#000099" size="2">PreCalcMacro</font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2">(</font></font><font color="#333333"><font size="2"><font size="2">out</font></font><font size="2"><font size="2"> </font></font><font size="2"><font size="2">int</font></font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2"> </font></font><font color="#c4c4c4" size="2"><font color="#c4c4c4" size="2">n1</font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2">, </font></font><font color="#333333"><font size="2"><font size="2">out</font></font><font size="2"><font size="2"> </font></font><font size="2"><font size="2">int</font></font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2"> </font></font><font color="#c4c4c4" size="2"><font color="#c4c4c4" size="2">n2</font></font><font color="#e0e0e0" size="2"><font color="#e0e0e0" size="2">);</font></font></div>

<div>&nbsp;</div>
<div><font color="#000000">//My IronPython code (the return value of GetPreCalcSourceUnitString() ):</font></div>
<div><font color="#000000">number1 = 2<br>number2 = 3<br></font></div>
<div><font color="#000000"></font>&nbsp;</div>
<div><font color="#000000">Now, after this code executes, the values of firstNumber and secondNumber remain unchanged.</font></div>
<div><font color="#000000">What do I need to do to have these values update to what the python method set them to?</font></div>
<div><font color="#000000"></font>&nbsp;</div>
<div><font color="#000000">Thanks!</font></div>
<div>&nbsp;</div></blockquote></div><br><br clear="all"><br>-- <br>--<br>Patrick Burrows<br><a href="http://www.CleverHumans.com">http://www.CleverHumans.com</a>