Wafl Home

Command Line Interpreter Tutorial

Command Line Interpreter

Command line interpreter clWafl is initially intended to be used as a testing tool for Wafl library development. However, its applicability extends far beyond. It has been applied in database scripting, data importing and bulk processing, HTML tutorial building, and many other domains.

Command line interpreter usage syntax is:

clWafl [<options>] <program>

where <program> may be:

<program file name> [<arguments>]

or

-code <source code> [-args <arguments>]

and <options> is blank separated list including following options:

-libdir:<lib directory>
-env:<environment parameter>
-args <arguments>
-dbdriver:<database driver>
-db:<database alias>
-user:<database connection user name>
-pwd:<database connection password>
-memory
-timer
-repeat:<n>
-listlib           
-msgs
-source
-wait

Basic options include:

  • libdir - sets an additional location of Wafl library files. Even if it is used, libraries are searched in current working directory, first.
  • env - sets environment variables before the program evaluation. If used with DB2 database, it sets both OS environment and DB2 environment variables.
  • args - begins a list of command line arguments if program is specified inline.

Options dbdriver, db, user and pwd determine database access:

  • dbdriver - sets the driver. It may be ODBC or DB2;
  • db - sets the database alias. If ODBC is used, an ODBC System DSN is expected. If DB2 is used, a DB2 database alias is expected;
  • user - sets the user name;
  • pwd - sets the password.

Options repeat, memory and timer are usable in benchmarking and testing:

  • memory - reports the memory usage;
  • timer - reports durations of evaluation phases;
  • repeat - repeats the program evaluation <n> times.

Options listlib and msgs are usable in debugging:

  • listlib - lists built in functions and theirs types;
  • msgs - reports type checking messages even if the program is successfully evaluated.

Options wait and source are usable in bulk evaluations:

  • wait - waits for a key after the program evaluation. This option is usable in benchmarking;
  • source - outputs the program file source code in transferable and library independent form. (This form is quite unreadable.)

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.