spc_4x4.gif (45 byte)
5. REBOL language
spc_2x2.gif (43 byte)
grd_2.gif (669 byte)
spc_2x2.gif (43 byte)
grd_3.gif (736 byte)


REBOL is a messaging language that provides a broad range of practical solutions to the daily challenges of Internet computing. REBOL/core is the foundation for all REBOL technology. While designed to be simple and productive for novices, the language extends a new dimension of power to professionals. REBOL offers a new approach to the exchange and interpretation of network-based information over a wide variety of computing platforms. REBOL scripts are as easy to write as HTML or shell scripts. A script can be a single line or an entire application.


This is a script example written in REBOL/view (the graphic version of the REBOL language). It passes the input fields to VEGA as parameters for a specific function.

There are three main functions, included in the "Vega.r" interface file, that allows communication between the REBOL and the VEGA program, through the TCP/IP port:

1) VegaOpen: connects the REBOL interpreter to the VEGA TCP/IP port, defining the host name (or IP), the TCP/IP port number, the user name and password for authentication.

2) VegaCmd: sends a command to VEGA in synchronous mode.

3) VegaClose: closes and frees the communication port. Each VEGA session can run one script at a time.

By changing the VegaOpen parameters, you can run a script on a PC to control a remote VEGA host. With VegaCmd you can exploit all VEGA functions in a very simple way. This is an example of REBOL script:

Script: Remarks:
  Title: "My first REBOL script"
  Date: 20-Feb-2003
  File: %test.r
  Author:  "My name"
  Version: 1.0.0
This is the header of the REBOL script.
do %Common\Vega.r

Load the interface file.

VegaOpen VegaDefHost VegaDefPort VegaDefUser VegaDefPass

Open the communication port with VEGA using default parameters.

VegaCmd {Open "MyMolecule.pdb"}

The Open command loads a molecule into the VEGA framework.

VegaCmd "PluginGet TotAtm"

If you want obtain a value of a VEGA environment variable, you must use the Get or PluginGet VEGA commands and the value is copied in the VegaRes REBOL variable.

print VegaRes

Print the result (the number of the atoms) in the REBOL console.


Close the communication port.

The complete list of the functions accessible trough scripting languages is available in the VEGA manual.

VEGA can interpret commands with extended syntax that can be sent via the console window, the windows class port and the TCP/IP connection (PowerNet plug-in). The users interested in VEGA scripts can consult the comprehensive REBOL manual at the REBOL Technologies website and the complete list of extended commands usable in the VEGA manual. In the current VEGA release several scripts are included to carry out some typical procedures such as batch conversion of all file in a folder, batch MOPAC runs, residue selection, automatic trajectory quenching with frame extraction, etc. These examples can be used as templates to create new customized scripts. VEGA includes a graphical interface to create, modify, manage and run the scripts.

Script manager included in VEGA

Previous page   4. PowerNet - Network interface 6. Conclusion   Next page