next up previous
Next: COPYMESS makes copies of Up: INSTRUCTIONS Previous: ASSEMBLE assembles messages in

ASSI assigns values to arrays and multiple nodes

Syntax:

    ASSI<| <variable> | <node> |  /range/ := <nest of constants>;

This instruction is used to assign values to arrays of any number of indexes or capacity to multiple nodes.
<variable> is a name of an indexed variable;
<node> a name of an indexed node;
/range/ is a range of indexes within the range defined for the node or variable.

ASSI can be used in any type of node.

Examples:

  1. Let Alpha be an array of CHAR of one index. The instruction:

      ASSI Alpha[2,4] := ('a', 'r', 's');
    assigns the values 'a' to Alpha[2], 'r' to Alpha[3], 's' to Alpha[4].
    If r was declared r: ARRAY[1..3, 2..4, 1..2] OF INTEGER then the instruction:
       ASSI r[1..2, 2..4, 1..2] := ( ( (3, 3), (5, 6), (8, 9) ),
                                    ( (6, 7), (0, 1), (9, 2) ) )
    assigns the values:
       r[1, 2, 1] = 3;   r[1, 2, 2] = 3;
       r[1, 3, 1] = 5;   r[1, 3, 2] = 6;
       r[1, 4, 1] = 8;   r[1, 4, 2] = 9;
    
       r[2, 2, 1] = 6;   r[2, 2, 2] = 7;
       r[2, 3, 1] = 0;   r[2, 3, 2] = 1;
       r[2, 4, 1] = 9;   r[2, 4, 2] = 2;
    the instruction does not assign values to the elements:
       r[3, 2, 1]  r[3, 2, 2]  r[3, 3, 1]  r[3, 3, 2]  r[3, 4, 1]  r[3, 4, 2]
  2. The following instruction assigns the paths of 3 clients in a supermarket:
       ASSI Paths[1..3, 1..5] :=
                       {Stage 1  Stage 2    Stage 3       Stage 4     Stage 5}
       ( ( { Client 1} 'Entry', 'Fruits',  'Bread',      'Beverage', 'Exit'),
         ( { Client 2} 'Entry', 'Bread' ,  'Canned_Food, 'Exit',     '    '),
         ( { Client 3} 'Entry', 'Pastry',  'Bread,       'Fruits',   'Exit') );
    The value assigned to Path[2, 3] is 'Canned_Food' as the third stage of the second client. Texts between {} are comments to explain the data.


domingo c
Mon Mar 20 17:36:19 PST 2000