Run script in Windows Console

There is a console runner available from ReoScript v1.2. The script file could be executed by this shell runner program.

Getting Console Shell

Download ReoScript binary library or build source file. Console shell compiled as following name:
ReoScriptShell.exe

Getting Started

1. Open Notepad, write following code and save file as "Sample.reo":

Sample.reo:
function hello() {
    console.log('Hello World!');
}
   
hello();

2. In Windows Command Prompt, execute the following command:
C:\> ReoScriptShell.exe Sample.reo

3. The 'Hello World!' will be printed out:
C:\> ReoScriptShell.exe Sample.reo
Hello World!

C:\> 

Enable/Disable Core Features Library

All Core Features will be supported if script executed from Console Runner. See more about CoreFeatures.

Runner Parameters

-workpath: Specify the work path for Runner

When another script file may be imported from current script file by import keyword. The relative path of script file depends on workpath to locate where does the file exist. e.g.:
Sample.reo:
    import "other.reo";      // import another script file
    other_func();           // dummy call function defined in other.rs

By default, ReoScript uses the default path where ReoScript.exe starting up. It is possible to change workpath by specifying workpath argument in console:
    C:\> ReoScript.exe Sample.reo -workpath "D:\Scripts"

-debug: Enable debug support

There is an object name 'debug' will be added into GlobalObject in script. The debug object provides the following methods:
* debug.assert(boolean)
* debug.assert(result, expect)
* debug.Stopwatch

For example:
C:\> ReoScript.exe Sample.reo -debug

-exec: Run specified script

Sample.reo:
function hello() {
    console.log('Hello World!');
}

Execute runner with -exec argument:
C:\> ReoScript.exe Sample.reo -exec "hello();"
Hello World!
        
C:\> 

Last edited Jan 25, 2014 at 6:12 AM by unvell, version 9