Hi Jaskaran,
The
On the other hand, if you're looking for a way to terminate the current script without exiting the process, you can call
Note that doing so will generate a
Another possibility might be to have your
Good luck!
The
WScript.Quit method simply exits the process, and you can easily expose a similar API with ClearScript:engine.Script.Quit = new Action<int>(Environment.Exit);
ScriptEngine.Interrupt():
engine.Script.Quit = new Action(() => ScriptEngine.Current.Interrupt());ScriptInterruptedException that you'll have to catch.Another possibility might be to have your
Quit API throw a custom exception. The problem there is that the script can disable error propagation via On Error.Good luck!