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}"); ```