The next example demonstrates the effects of the scopes of variable assignments. It implements a simple multiplication table with Respix.
The utilized multiply functions takes two variable inputs, x
and y
and replaces itself with the product of these two numbers.
The header row defines the x-values: In each cell, the x-value is specified for each cell in this column: $
for a variable assignment, C:
sets the scope of this assignment to the complete column.
The leftmost column defines the y-values: In each cell, the y-value is set for each cell in this row.
For the last cell (in orange) a deviating x-value is set to 10 (just for demonstration). Since the value specified for this cell in particular has a higher priority than the value specified for the whole column, the product in this cell is computed as 10 times 10.
Input:
Output: