previous contents index next
(Symb. Constants) Contents Index (Operators..)

2.6 Variables (Var)

SCARLET becomes a real programming language by putting variables at our disposal. They always have to be denoted by elements of Identifier. In contrast to many other programming languages (e.g., C), all variables have to be declared at the beginning of the program where they will be used in. For more details on this topic, please refer to paragraph 'Variables' of RDL. The intention of a preceding definition is to classify each variable as an object of one of the data types known by SCARLET, namely INT, STRING, BOOL, or CELL (and connected to this to allocate the memory size needed). Once the type is fixed, it cannot be changed during a run of the program. That is why we have the right to speak more precisely of elements of

instead of Var.


If we form the projection of a cell variable on a certain register by attaching the register name, we get an object of IntVar again, when the register type is INT,

CellVar.IntRegIdentifier

and an element of StringVar, when it is of type STRING.

CellVar.StringRegIdentifier

To conclude this paragraph we give a little overview over all possibilities to obtain integer or string type variables:

IntVar - Syntax:

Syntax: IntVar

StringVar - Syntax:

Syntax: StringVar



previous contents index next
(Symb. Constants) Contents Index (Operators..)