[IronPython] Announcing IronPython 2.0 Beta 2

Matthew Barnard m.stephen.barnard at gmail.com
Sat May 3 10:41:14 CEST 2008


This is the expected behavior.
CreateScriptSourceFromString(string) defaults to SourceCodeKind.Expression

(ScriptEngine.cs) ------------------------------------------

public ScriptSource/*!*/ CreateScriptSourceFromString(string/*!*/ code) {
            ContractUtils.RequiresNotNull(code, "code");

            return CreateScriptSource(new SourceStringContentProvider(code),
null, SourceCodeKind.Expression);
        }


----------------------------------------------

On Fri, May 2, 2008 at 11:39 PM, Andy.Tao <taozuhong at qq.com> wrote:

> maybe that is a bug:
>
>
> the detail as follow:
> private void btnExecute_Click(object sender, EventArgs e)
> {
>     try
>     {
>         ScriptRuntimeSetup runtimeSetup = new ScriptRuntimeSetup(true);
>         ScriptRuntime ScriptRuntime = ScriptRuntime.Create(runtimeSetup);
>         ScriptRuntime.GlobalOptions.DebugMode = true;
>
>         ScriptEngine scriptEngine = ScriptRuntime.GetEngine("py");
>
> scriptEngine.CreateScriptSourceFromString(txtScriptSource.Text).Execute();
> // this line will be throw out a exception
>         scriptEngine.CreateScriptSourceFromString(txtScriptSource.Text,
> SourceCodeKind.Statements).Execute();   //this line OK
>
>
>         //m_RemoteScript.ExecuteCode(txtScriptSource.Text);
>     }
>     catch(Exception ee)
>     {
>         MessageBox.Show(ee.Message);
>     }
> }
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>


-- 
___________________________
Matthew Barnard
602 540 0652
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080503/aca7bbc2/attachment.html>


More information about the Ironpython-users mailing list