TCLrte - WASD RTE environment for TCL.

TCLrte is a TCL program, that accepts WASD RTE request, prepares CGI-like environment and runs the requested TCL script. When the request is serviced, it waits for the new request and runs the next TCL script, and so on, while httpd doesn't abort the TCLrte process.

TCLrte gets CGI variables from httpd, places them into TCL env() array, finds the requested TCL script, executes it and closes the httpd transaction.

TCLrte is tested against IPS TCL from DEC.

1. Scripting environment.

1.1. CGI variables.

All the request CGI variables are placed in the TCL env() array, named just like httpd names them - env(WWW_*). For example env(WWW_QUERY_STRING) TCL string variable represents the request query string.

1.2. Script output.

The basic way of script output is the TCL puts ... procedure. As stdout is opened to SYS$OUTPUT: all such output comes directly to httpd.

In addition the file can be opened to $RTE_output pointing to SYS$OUTPUT: and everything can be written there.

1.3. Script input.

Normally TCLrte inputs PUT/POST data directly by reading from file named $RTE_input pointing to HTTP$INPUT: or simply reading from stdin opened to HTTP$INPUT:.

1.4. RTE variables.

There is a number of special names for RTE to script interaction. See RTEset for detailed information.

1.5. Error reporting.

TCLrte has a built-in RTE_error_report procedure. To report an error the script should call it with the following parameters:

RTE_error_report http_status error_text [module_name] [line_number];

In addition TCLrte has an error handler supporting any error return from script.