A.3 Variables

In the Input Deck database an arbitrary number of variables can be defined. Variables may be defined only once and can not be overwritten later on. A data type declaration of variables is not necessary. Since the expressions stored in a variable will be evaluated at runtime (see Section 3.5) the data type will be determined during calculation.

Two simple examples of variable-definitions:

number    = 3;
some_text = "some Text";

Variable names may consist of letters, numbers, and underscores (_) only. The first character must not be a number. Variables can be classified by the different kind of access allowed for the application. Usually variables are read only to the application. If a different access-type is mandatory for certain variables an access-type qualifier must be written in front of the variable name:


Table A.8: Access-types for variables.
Access-type Access-type qualifier
read and write ext
read only
hidden aux

In the following example the variables x, y, ex, and ey are defined. The variables x and y describe the components of a vector, the variable a calculates the length of the vector and ex and ey denote the normalized vector components.

ext x = 32;
ext y = 4;
aux a = sqrt(x * x + y * y);    // auxiliary variable
ex    = x / a;
ey    = y / a;

The application is allowed to change the values of the variables x and y as they have been declared writable using the qualifier ext. The variable a is used as an auxiliary variable and, therefore, is declared invisible to the application using the qualifier aux. The variables ex and ey can only be queried by the application as they are defined read-only.

The type of a variable declared once can not be changed.

aux a = 1;
ext a;          // Error! Variable `a' has already been
                // declared as auxiliary before.

Robert Klima 2003-02-06