var code = @" function add(a, b) { return a + b; } print(add(2, 3)); "; var runner = new ProtoScriptRunner(); var result = runner.Execute(code);
var code = @" function greet(name) { print('Hello, ' + name + '!'); } greet('World'); "; var runner = new ProtoScriptRunner(); var result = runner.Execute(code);In both examples, we create an instance of ProtoScriptRunner and use its Execute method to execute ProtoScript code. The code is passed as a string argument to Execute. The result of the execution is returned as an object.