This project has moved and is read-only. For the latest updates, please go here.

Executing a script

Executing a script runs a script from start to finish. For example, to execute the script at "c:\test.js" use the following code:

var engine = new Jurassic.ScriptEngine();

If you have the code to run in a string, use the Execute() method:

var engine = new Jurassic.ScriptEngine();

Note: executing a script is different from evaluating it in the following ways:
  1. Evaluate() returns a value and Execute() does not.
  2. Execute() runs slightly faster.
  3. Variables declared inside Evaluate() can be deleted whereas variables declared inside Execute() cannot.
The specification uses the terms "global code" and "eval code" to describe these differences.

Next tutorial: Accessing and modifying global variables

Last edited Aug 25, 2010 at 2:38 PM by paulbartrum, version 7


No comments yet.