@c+
module test12_6 -- bounds check twoDimensions
-- test of array bounds check (2 dimension )
private
 integer i,j;
 const max = 2;
 const mlo = 1;
 typedef integer range [0..mlo] zero_mlo;
 integer array [zero_mlo][zero_mlo] a;
begin
 i := 0;
 do i <= max -> read a[i][0]; i := i+1; od; -- data 1 2 3 
 a[0][1] := a[0][0];
 i := 1;
 do i <= max -> 
	i := i+1;
	a[i][1] := a[i-1][1] + a[i][0] ; 
 od;
 i := 0;
 do i <= max -> 
	i := i+1;
	a[i][2]:= a[i][0] * a[i][1]; 
 od;
 i := 0;
 j := 0;
do i <= max & j <= max ->
	write a[i][j]; j := j+1;
	if j > max -> 
		i := i+1;
		j := 0;
	 [] j <= max -> skip;
	fi;
od;
 -- output
 -- run time error
 end.
