Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created October 16, 2015 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshVarty/a58b0351143fa958a504 to your computer and use it in GitHub Desktop.
Save JoshVarty/a58b0351143fa958a504 to your computer and use it in GitHub Desktop.
var state = CSharpScript.RunAsync(@"int x = 5; int y = 3; int z = x + y;""").Result;
state = state.ContinueWithAsync("x++; y = 1;").Result;
state = state.ContinueWithAsync("x = x + y;").Result;
ScriptVariable x = state.Variables["x"];
ScriptVariable y = state.Variables["y"];
Console.Write($"{x.Name} : {x.Value} : {x.Type} "); // x : 7
Console.Write($"{y.Name} : {y.Value} : {y.Type} "); // y : 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment