.script

.script runs a script in languages such as JavaScript.

Syntax

usage: .script [options] [path]
options:
  -c,--charset <arg>   specifies the file character set

If the script file is not specified, the end of script is .end script on a line by itself.

Example

-- test running a script from a file using a temporary script engine.
.script -t lib/print.js

-- test running a script using a non-temporary script engine
.script
function println (str)
{
        display.println (interpreter, str);
}

println ("你好,世界");
.end script

-- re-use the script engine above to call the same println function created.
.script
println ("你好,世界");
.end script

Implementation

Jaqy uses Java Scripting API to create a ScriptEngine .

See Also