Helma Logo
main list history
previous version  overview  next version

Version 3 by hannes on 19. May 2009, 14:11

The Helma NG shell is great for interactive and explorative programming. To start it, either run <code>helma</code> without a script, or add the <code>-i</code> or <code>--interactive</code> switch before the script.

The Helma shell uses *JLine|http://jline.sourceforge.net/* to provide a number of nice features, including:

* Autocompletion for JavaScript and Java objects and methods
* Input history using the up and down keys that persists between sessions
* A readln() function with configurable prompt and echo characters
* Multiline input for JS functions and object literals

You can enter and evaluate any JavaScript expression. You can scroll through your session history using the <Up> and <Down> keys, hitting <Tab> will try to auto-complete your current input. Use the <tt>include</tt>, <tt>require</tt>, or <tt>import</tt> functions to load any Helma NG modules:

helma> include('helma/file');
helma> var file = new File('README.txt');
helma> file.open();
helma> file.readln();
Helma NG
helma> file.close();

The shell history is kept in a file called <code>.history</code> in the Helma NG home directory. To exit the shell <code>Ctrl-D</code> <code><Ctrl-D></code> or enter <code>quit()</code>.