
{: test that out of bounds array index causes a fatal error }

{$d+}
program d012( output );
type rind = 8..24;
var
   ar : array[rind] of real;
   k  : integer;

function side : integer;
begin
   side := k;
   k := k+1;
end;
begin {d012}
   k := 7;
   ar[side] := 6;
   if k <> 8 then
      writeln( 'side effect error evaluating array index' );

   k := 7;
   writeln( 'ar[', k:1, '] is ', ar[k]:1:1 );
end. { d012 }

