<div><div class="gmail_quote">On 15 August 2011 16:36, Charles Rich <span dir="ltr">&lt;<a href="mailto:rich@wpi.edu">rich@wpi.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Mark, Thanks for the reply, but that just pushes the problem one<br>
level back, i.e., how is &#39;whatever&#39; set to the result of the<br>
evaluation?   The point is that I need to be able to pass the result<br>
of the evaluation around *outside* the evaluator and then feed it back<br>
in.<br>
<font color="#888888"><br>
-CR<br>
</font><div class="im"><br>
On Mon, Aug 15, 2011 at 11:27 AM, Marek Safar &lt;<a href="mailto:marek.safar@gmail.com">marek.safar@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; Hi, I am new to Mono, but becoming a big fan quickly (more detail<br>
&gt;&gt; below regarding what I am doing with it).  To get right to the point,<br>
&gt;&gt; however, I would appreciate advice on how to *programmatically* set<br>
&gt;&gt; the value of a variable that can be seen inside the Evaluator, e.g.,<br>
&gt;&gt;<br>
&gt;&gt;        var temp = Evaluator.Evaluate(&quot;...&quot;);<br>
&gt;&gt;        Evaluator.PutVar(&quot;x&quot;, temp); // so such method exists!<br>
&gt;&gt;        Evaluator.Run(&quot;... x ...&quot;);<br>
&gt;<br>
&gt; You can simply run C# statement which will do the assignment. Trivial<br>
&gt; example can look like this<br>
&gt;<br>
&gt; Evaluator.Run(&quot;x = whatever&quot;);<br>
&gt;<br>
&gt; Marek<br>
&gt;<br>
<br>
<br>
<br>
</div><div class="im">--<br>
Dr. Charles Rich, Professor of Computer Science<br>
Interactive Media and Game Development<br>
Worcester Polytechnic Institute, Fuller Laboratories B25b<br>
100 Institute Road, Worcester, MA 01609-2280<br>
<br>
Email: <a href="mailto:rich@wpi.edu">rich@wpi.edu</a>   Phone: <a href="tel:508-831-5945" value="+15088315945">508-831-5945</a>   Fax: <a href="tel:508-831-5776" value="+15088315776">508-831-5776</a><br>
Home: <a href="http://www.cs.wpi.edu/~rich" target="_blank">http://www.cs.wpi.edu/~rich</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Mono-devel-list mailing list<br>
<a href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
</div></div></blockquote></div><br>Hi Charles,</div><div><br></div><div>I think what Marek is trying to say is, instead of consuming the output of the first evaluate method, perform an assignment to a variable, then reuse that variable in subsequent calls:<div>
<br></div><div>&gt;&gt;        var temp = Evaluator.Evaluate(&quot;...&quot;);</div><div>&gt;&gt;        Evaluator.PutVar(&quot;x&quot;, temp); // so such method exists!<br>&gt;&gt;        Evaluator.Run(&quot;... x ...&quot;);</div>
<div><br></div><div>Evaluator.Run(&quot;var x = ...&quot;);</div><div>Evaluator.Run(&quot;... x ...&quot;);</div><div><br></div><div>If you need to get &#39;x&#39; out, then you can use the GetVars() method as you have previously found.</div>
<div><br></div>-- <br>Tom Spink<br>
</div>