From d6db19000cb713d89ac33815a6a5572bed43e950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Matou=C5=A1ek?= Date: Mon, 19 Dec 2016 14:33:17 +0100 Subject: [PATCH] Updated Scripting API Samples (markdown) --- Scripting-API-Samples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripting-API-Samples.md b/Scripting-API-Samples.md index 54c7898..5106496 100644 --- a/Scripting-API-Samples.md +++ b/Scripting-API-Samples.md @@ -98,13 +98,13 @@ var script = CSharpScript.Create("X*Y", globalsType: typeof(Globals)); ScriptRunner runner = script.CreateDelegate(); for (int i = 0; i < 10; i++) { - await runner(new Globals { X = i, Y = i }); + Console.WriteLine(await runner(new Globals { X = i, Y = i })); } ``` #### Run a C# snippet and inspect defined script variables ```csharp -var state = await CSharpScript.RunAsync("int answer = 42"); +var state = await CSharpScript.RunAsync("int answer = 42;"); foreach (var variable in state.Variables) Console.WriteLine($"{variable.Name} = {variable.Value} of type {variable.Type}"); ```