previous contents index next
(..Statement Part..) Contents Index (SDL: ..)

3.2.3 Structure of the Statement Part (StatementPart)

StatementPart - Syntax:

Syntax: StatementPart

This second (and last) main part of a RDL program starts with the keyword

START

Like this the statement part is set off against the preceding declaration part. START is followed by an arbitrary amount of assignments to sites of the retina

CellAssignment ;

or to cell variables

VarAssignment ;

in any order whatever.


 

SCARLET evaluates all these devices only once beginning at START. Contents of cells and cell variables are changed immediately after each assignment. This seems not to be worth mentioning, since it is the usual way of evaluating computer programs. But glancing at SDL, we will soon see that those programs form an exception to the rule...


 
Example 40:

This is an example of a trivial two-dimensional retina. For there is nothing changed at all, the sites stay with the initialization values in their registers, thus here {0,""}. Nevertheless the keyword START must appear.


RETINA initial;

RANGE [0,0]..[5,5];

REGISTER INT num;
         STRING str;

VAR    /* could be omitted */

CONST    /* -"- */

START

Source Code: initial.rdl


Example 41:

Just another example of a retina.

The last device causes each site within a certain - but yet not fixed - area to get the state of another site that is found by a random procedure.


RETINA modern_art;

RANGE [0,0]..[20,15];

REGISTER STRING point;

VAR

CONST yellow = "*";
      red = "/";
      green = "+";
      blue = "-";

START
   
   [0,0]..[20,10] = {blue};
   [1,5] (3) [20,15] = {green};
   [7,5] (2,1) [15,10].point = red;
   [2,3]..[17,7] = {yellow};
   [10+rand(-2,2),1]..[19,5] = [10+rand(-5,5),7+rand(-3,3)]; 

Source Code: art.rdl


previous contents index next
(..Statement Part..) Contents Index (SDL: ..)